쉘 (Shell)에서 작은 프로그램을 만드는 법을 배우고 있으며 시스템 계산기 (bc -l)를 사용하는 함수를 정의하는 방법을 모색하고있었습니다. 난 내가 할 노력하고있어 표시됩니다 :유닉스 쉘 스크립트 함수
#!/bin/bash
square(){
I need help here!
}
cube(){
I need help here!
}
rectangle(){
I need help here!
}
exit(){
help
}
I need help here!
echo "Little program that computes the following:"
echo "a) Surface of a square"
echo "b) Volume of a cube"
echo "c) Surface of a rectangle"
echo "e) exit"
echo "Choose the option you want to compute"
read answer
if [ $respuesta == "a" ]
then echo "What's the side of the square"
read l`
을 내가 이제 사용자의 답변을 "먹는"나의 기능을 calll 다음 계산을 표시하는 방법 그렇지 않은 선 후. 상황이 최악의 경우는 계산을 마친 후에 사용자에게 계속하거나 나가기를 요청해야하기 때문입니다. 누구든지 나를 도울 수 있다면, 나는 매우 감사 할 것입니다. 내 영어로 미안해. 나는 원어민이 아니다.
당신은이처럼 함수를 호출 할 수 있습니다 : 평방 – tinySandy