????Q:1 Shell????????????????????
??????:???Shell?????????????????????????????????????????????????????????????????????????????????????Щ???????????????????(Shell???)???????Щ???????????
????Q:2 ?????????shell????θ????????????shell
??????:??Linux????????“/bin/bash”???????shell??????????????????????chsh?????????????shell????????????:
????# chsh <username> -s <new_default_shell>
????# chsh linuxtechi -s /bin/sh
????Q:3 ??????shell??????????Щ?????????
????????shell?????????????????????????????
?????????????
??????????????
??????????????????????????????Щ??????????д??????????????“set”???????
???????????????????????????壬??????????????????“echo $<??????>”????
????Q:4 ??ν????????????????????????λ???
??????????????????????????
???????????
????2>&1 (# ls /usr/share/doc > out.txt 2>&1 )
????????????
????&> (# ls /usr/share/doc &> out.txt )
????Q:5 shell?????“if”?????????
???????????????£?
if [ Condition ]
then
command1
command2
…..
else
if [ condition ]
then
command1
command2
….
else
command1
command2
…..
fi
fi
????Q:6 shell?????“$?”?????????????
????????д???shell????????????????????????????г??????if?????????“$?”??????????????????????????????????£?
????root@localhost:~# ls /usr/bin/shar
????/usr/bin/shar
????root@localhost:~# echo $?
???????????????0???????????????г????
????root@localhost:~# ls /usr/bin/share
????ls: cannot access /usr/bin/share: No such file or directory
????root@localhost:~# echo $?
?????????????????0????????????????