1.定位光标位置
tput cup r c
tput cup 10 20
2.显示终端信息列表
infocmp $TERM
3.获取功能键
cat -v
4.命令需注意的地方
MATCH=` grep z yjg.txt `
5.打印数据
[root@localhost yjg]# pr <<- M
> asdfasdf
> sadfsdf
> sadfsadf
> asdf
> M
5.set命令
set -n 读命令但不执行
set -v 显示读取的行
set -x 显示所有命令及参数
#!/bin/sh
#error.sh
set -x
LIST="Peter Susan John Barry Lucy Norman Bill Leslie"
echo -n "Enter your name :"
read NAME
for loop in $LIST
do
if [ "$loop" = "$NAME" ]; then
echo "you are on the list,you're in"
break
fi
done
[root@localhost yjg]# chmod +744 error.sh
[root@localhost yjg]# ./error.sh
+ LIST='Peter Susan John Barry Lucy Norman Bill Leslie'
+ echo -n 'Enter your name :'
Enter your name :+ read NAME
Lucy
+ for loop in '$LIST'
+ '[' Peter = Lucy ']'
+ for loop in '$LIST'
+ '[' Susan = Lucy ']'
+ for loop in '$LIST'
+ '[' John = Lucy ']'
+ for loop in '$LIST'
+ '[' Barry = Lucy ']'
+ for loop in '$LIST'
+ '[' Lucy = Lucy ']'
+ echo 'you are on the list,you'/''re in'
you are on the list,you're in
+ break
1255

被折叠的 条评论
为什么被折叠?



