stty
zmc@SUSE11:~> stty -a
speed 38400 baud; rows 56; columns 142; line = 0;
intr = ^C; quit = ^\; erase = ^?; kill = ^U; eof = ^D; swtch = <undef>; start = ^Q; stop = ^S; susp = ^Z;
rprnt = ^R; werase = ^W; lnext = ^V; flush = ^O; min = 1; time = 0;
-parenb -parodd cs8 -hupcl -cstopb cread -clocal -crtscts
-ignbrk -brkint -ignpar -parmrk -inpck -istrip -inlcr -igncr icrnl ixon -ixoff -iuclc -ixany -imaxbel -iutf8
opost -olcuc -ocrnl onlcr -onocr -onlret -ofill -ofdel nl0 cr0 tab0 bs0 vt0 ff0
isig icanon iexten echo echoe echok -echonl -noflsh -xcase -tostop -echoprt echoctl echoke
intr:中断(interrupt)目前正在运行的程序
quit:停止(stop)目前正在运行的程序
susp:(terminal stop)目前正在运行的程序
stop:停止目前屏幕输出
start:停止重新启动目前屏幕的输出
kill:删除目前命令行上所有文字
erase:向后删除字符
set [-uvCHhmBx]
参数:
-u:默认不启用,若启用,当使用未设置的变量,会显示报错信息
-v:默认不启用,若启用,讯息被输出前,会显示信息的原始内容
-x:默认不启用,若启用,在命令被执行前,会显示命令内容(++)
-h -H -m:默认启动,和历史命令有关
-B:默认启用,和刮号[]的作用有关
-C:默认不启用,若启用,>输出时若文件存在,文件不会被覆盖
zmc@SUSE11:~> echo $-
himBH
zmc@SUSE11:~> set -u
zmc@SUSE11:~> echo $-
himuBH
zmc@SUSE11:~> set -x
zmc@SUSE11:~> uname -a
+ uname -a
Linux SUSE11 2.6.32.12-0.7-default #1 SMP 2010-05-20 11:14:20 +0200 x86_64 x86_64 x86_64 GNU/Linux
zmc@SUSE11:~> set -C
zmc@SUSE11:~> echo 'abc' > temp.txt
-bash: temp.txt: cannot overwrite existing file
zmc@SUSE11:~> echo 'abc' > temp.txt
zmc@SUSE11:~> cat temp.txt
abc
网友评论