Learn to write your first shell script...

Shell scripting is writing a series of command for the shell to execute. 

You can use ssh application name "putty".

If you have windows PC then use power shell application or cmd to launch .sh files.

You can use simple notepad or notepad++ to write these scripts

 

Steps to create your first Shell Script !!

  1. Create a file using a vi editor. Name script file with extension .sh (if using putty)
  2. Start the script with #! /bin/sh (if using notepad start from #2)
  3. Write below mentioned code.
  4. Save the script file as filename.sh
  5. For executing the script type bash filename.sh

Once script is saved. Run it as ./filename.sh and you can see below output.


Cheers to you on learning your first shell script !!!

No comments:

Post a Comment