Saturday, April 30, 2016

Bash Script Note : How to write your first Bash Script



How to write your first Bash Script

https://linuxconfig.org/bash-scripting-tutorial


1. Create  a file called hello.sh in promt:
   
        cat > hello.sh 

2. Edit content

     # Test file

3. press CTRL+D to save file

4. display contents, type

    cat hello.sh

5. Edit contents
 
   vi hello.sh

6. make the file executable

   chmod +x hello.sh

7. execute your first bash script

  ./hello.sh

No comments:

Post a Comment