vi /tmp/ceshi.sh
#!/bin/sh
while [ true ]; do
/bin/sleep 1
/bin/date >>/tmp/date.txt
done
2.後臺運行
nohup /tmp/ceshi.sh 2>&1 > /dev/null &
3.確認每秒執行
tail -f /tmp/date.txt
4. 停止腳本運行進程
ps -ef | grep ceshi.sh |kill -9
vi /tmp/ceshi.sh
#!/bin/sh
while [ true ]; do
/bin/sleep 1
/bin/date >>/tmp/date.txt
done
2.後臺運行
nohup /tmp/ceshi.sh 2>&1 > /dev/null &
3.確認每秒執行
tail -f /tmp/date.txt
4. 停止腳本運行進程
ps -ef | grep ceshi.sh |kill -9
》》》CUT命令 1,選項: 2,示範: 》》》TR命令 1, 替換字符/字符串,將a轉換爲A、將b轉換爲B、將c轉換爲C: tr abc ABC <
》》》整數比較 方法一: 1,[ num1 -eq num2 ] [[ num1 -eq num2 ]] 【注意:一定一定要注意前後一定要有的空格!】 2,整數比較運算符
》》》引用和轉義字符 1,雙引號、單引號、反引號: 2,區分雙引號單引號的典例: 3,總結{} [] () (()) 意義用法
本節我們討論如何在一個 Makefile 中包含其它的 makefile 文件。Makefile 中包含其它文件的關鍵字是“include”,
1.讀取配置 配置文件: key=value #!/bin/bash declare -A kv_dict=() function LoadConf() { file_name=$1 IFS="="
shell script 變量、常量和函數 函數 shell函數有兩種語法: 第一種 function name{ commands return } 第二種 name (){ commands