摘要: [root@localhost prog]# cat trap2.sh #!/bin/bash function cleanup() { echo "Received signals and cleanup files" } #trap 到SIG信号,自动停止 trap 'cleanup;exit 1' SIGHUP trap 'cleanup;exit 1' SIGI... 阅读全文
posted @ 2018-11-17 16:22 uxiuxi 阅读(1567) 评论(0) 推荐(0)
摘要: 检验下shell的随机数,看分布是否均匀 阅读全文
posted @ 2018-11-17 11:55 uxiuxi 阅读(186) 评论(0) 推荐(0)
摘要: cat filename.txt |while read LINE do echo $LINE done # LINE在这里面只是随便一个变量,并不是内置 或者 #!/bin/bash while read aa do echo $aa done< filename.txt #这种格式看起来更好 #!/bin/bash myfile=filename.tx... 阅读全文
posted @ 2018-11-17 11:02 uxiuxi 阅读(148) 评论(0) 推荐(0)