BCS Bash Scripting Basics


To create a new bash script a empty blank file must be created and properly labeled as “name.sh”. The name portion off the file specification should be replaced by a meaningful name.
Make the file specification executable by issuing the following command.
[codesyntax lang=”bash”]

chmod +x name.sh

[/codesyntax]
To pass parameters to the script they are included on the command line.
[codesyntax lang=”bash”]

./name.sh param1 param2 param3

[/codesyntax]
Should any of the parameters include special characters they should be surrounded by double quotes ‘param1 “param 2” param3’.

Mr. Arch Brooks, Software Engineer, Brooks Computing Systems, LLC authored this article.

Leave a Reply

Your email address will not be published. Required fields are marked *