If(2)
-
2022-04-22 Shell_script_4
IF #!/bin/bash read -p "enter income amount" Income read -p "enter expenses aount" Expense let Net=$Income-$Expense if [ "$Net" -eq "0" ] then echo "Income and expences are equal" elif [ "$Net" -gt "0" ] then echo "profit : " $Net else echo "Loss : " $Net fi CASE case word in pattern1) command-list1 ;; pattern2) command-list2 ;; patternN) command-listN ;; esac checked against word for match may ..
2022.04.22 -
2022-04-14 Shell_script_3
Shell script 예제 강의 시간에 배운 예제를 중심으로 이해해보자. read vim name.sh #!/bin/bash read -p "enter your name: " first last echo "First name is $first" echo "Last name is $last" 이름을 묻고 성과 이름으로 나눠 출력한다. if if [ ] syntax if [ 조건절 ] then 실행절 elif [ 조건절 ] then 실행절 else 실행절 fi 조건절에 사용될 수 있는 옵션들 기능 Numeric String Greater than -gt Greater than or equal -ge Less than -lt Less than or equal -le Equal -eg =, == Not equ..
2022.04.15