questions
1:
#!/bin/bash # auth: xiluhua # date: 2017-01-15 while true do read -p 'please input a film: ' film if [ -z $film ] then echo > /dev/null else if [ $film = 'q' ] then exit fi if [ $film = 'ironman' ] then echo $film' is a good film!' exit 0; else echo 'this film is not good enough' fi fi done
解决方案:$film改成"$film"
#!/bin/bash # auth: xiluhua # date: 2017-01-15 while true do read -p 'please input a film: ' film echo $film if [ -z "$film" ] then echo > /dev/null else if [ "$film" = 'q' ] then exit fi if [ "$film" = 'iron man' ] then echo "$film"' is a good film!' exit 0; else echo 'this film is not good enough' fi fi done
2. history -d 47 5
参数 5 没有起作用
3. 如何给less,cat命令设定tab缩进为4个空格?
4. yum list 结果的第三列枚举含义
root@vm-xiluhua /mnt # yum -q list | awk '{print $3}'| sort -u @anaconda @base installed local @updates