Linux_Shell_Scripting_With_Bash 学习笔记
时间:2007-07-22 来源:lovettab
FILENAME=”info.txt” //Bash设置变量;
printf “%s\n” “$FILENAME” //打印变量值;
DATE=`date` //在shell script中执行命令,加``;
date && printf “%s\n” “Hello” //&&的左右两边的cmds都被执行,要么执行第一个cmd时就失败;
date ‘duck!’|| printf “%s\n”“Hello” // ||左边的cmd失败时执行第二个cmd;
!! (or !-1)// repeat the last cmd(!后面支持通配符);
!a(Table Key) //repeat the most recent cmd that matches;
cmd ; !# //repeat the cmd once;
相关阅读 更多 +