????Q:7 ??shell???????α?????????? ?
????????if-then????ò??????? -gt ????????????????????????£?
????#!/bin/bash
????x=10
????y=20
????if [ $x -gt $y ]
????then
????echo “x is greater than y”
????else
????echo “y is greater than x”
????fi
????Q:8 shell?????break????????? ?
??????break???????????????????????е???????????????while??until????????break?????????????
????Q:9 shell?????continue????????? ?
??????continue???????break???????????????????????????????????????continue???????????????????????????????????????????????д?????????
????Q:10 ??????shell?????Case?????? ?
???????????????£?
case word in
value1)
command1
command2
…..
last_command
!!
value2)
command1
command2
……
last_command
;;
esac
????Q:11 shell?????while????? ?
?????????for?????while????????????????????????顣?????for?????while???????????????????????????檔????????
????while [ test_condition ]
????do
????commands…
????done
????Q:12 ???????????? ?
?????????chmod??????????????С????????£?
????# chmod a+x myscript.sh
????Q:13 “#!/bin/bash”?????? ?
??????#!/bin/bash??shell????????У??????饗shebang???С?????#???????hash????! ???? bang?????????????????? /bin/bash ????С?
????Q:14 shell?????for????? ?
??????for????????????
????for variables in list_of_items
????do
????command1
????command2
????….
????last_command
????done
????Q:15 ??ε???shell??? ?
?????????’-x’??????sh -x myscript.sh?????????shell????????????????????‘-nv’????( sh -nv myscript.sh)??
????Q:16 shell?????α????????
??????test??????????????????????????????????????????е??????????????
????Q:17 Bourne shell(bash) ??????Щ???????? ?
?????????????г???Bourne shell?????????????????????