aaaa@ubuntu:~$ ./test.sh
Enter the input : 4 + 1
The result: 5
aaaa@ubuntu:~$ ./test.sh
Enter the input : 4 / 9
The result: 0
aaaa@ubuntu:~$ ./test.sh
Enter the input : 4 - 10
The result: -6
이런식으로 결과 출력하는 사칙연산 계산기인데
#!/bin/bash
read -p "Enter the input: " x c y
if ["$c" = "+"]; then
let result=$x+$y
echo "result: " $result
elif ["$c" = "-"]; then
let result=$x-$y
echo "result: " $result
elif ["$c" = "*"];then
let result=$x*$y
echo "result: " $result
elif ["$c" = "/"]; then
let result=$x/$y
echo "result: " $result
fi
이렇게 하는거 맞아여?
= 이거 하나쓰는거 같음? -eq 나 ==썼떤거 같은데
오 맞는거같아요 감사합니다
Enter the input: 4 + 1 ./test5.sh: 줄 4: [+: 명령어를 찾을 수 없음 ./test5.sh: 줄 7: [+: 명령어를 찾을 수 없음 ./test5.sh: 줄 10: [+: 명령어를 찾을 수 없음 ./test5.sh: 줄 13: [+: 명령어를 찾을 수 없음
이런 오류가 생기는데 혹시 알려주실수있으신가요?ㅜㅜ