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
原文地址:https://www.cnblogs.com/docnan/p/5631992.html