Linux: bash script

This is for advanced bash programming study. Not the basic bash commands!

  1. methods to execute bash script
    Suppose we have a test bash script test.sh as:
# my first bash script
echo "Hello World!"

If it is successfully executed, "Hello World!" txt will be printed on your terminal screen.

  1. bash test.sh
  2. sh test.sh
  3. ./test.sh
    The first two methods will be executed without difficult, the third method usually require that you give the .sh file the permission to be executed.
  1. basic grammar of bash script
  • comment

comments this line

  • find contents

posted on 2016-07-01 09:47  DocNan  阅读(155)  评论(0编辑  收藏  举报

导航