#!/bin/rm
# Self-deleting script.
# Nothing much seems to happen when you run this... except that the file disappears.
WHATEVER=85
echo "This line will never print (betcha!)."
touch /home/hehehehe.txt
exit $WHATEVER # Doesn't matter. The script will not exit here.
# Try an echo $? after script termination.
# You'll get a 0, not a 85.
# 大家觉得这个有意义吗?用在哪里。请知道的告诉我下,谢谢。
Also, try starting a README file with a #!/bin/more, and making it executable. The result is a self-listing documentation file.
To avoid this possibility, a script may begin with a #!/bin/env bash sha-bang line. This may be useful on UNIX machines where bash is not located in /bin
阅读(771) | 评论(0) | 转发(0) |