`

while,if使用

阅读更多
while使用:

#! /bin/bash

while echo "im a shell"
do
   mkdir adir
   cd adir
   touch afile
   sleep 10s
done

if-else:

#! /bin/bash
if [ -f "a" ] ; then
   echo "文件存在"
else
   echo "文件不存在";
   touch a;
   echo "sdfsfsfs">>a
fi
分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics