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
#! /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