use of :

2017-12-12  本文已影响0人  lucientlau

: nop command

:
echo $?  # 0

$? the previous command return value

Dead loop

while :
do 
   operation-1
  .
  .
  .
done

the same with

while ture
do

done

Another example

if condition
then :
else
  take some action
fi
: ${username=`whoami`}

Clear file

: > file
cat /dev/null > file
上一篇 下一篇

猜你喜欢

热点阅读