Linux Shell Scripting TutorialIntroduction Tools required for shell scripting First shell script Interacting with user Operators Special characters in BASH scripting Variables in Linux BASH scripting Arrays Integer operations floating point operations String manipulation in shell scripting Parameter substitution Command Substitution Conditional statements Looping statements Passing parameters exit status of the script Functions Sourcing files
First example in linux shell scriptingYou should remember below things while writing the scripts.
- Every script should being with “#!/bin/bash”
- Comments can be added by prefixing the line with #
Before you execute above command, ensure that you modify the permission of the file sample1.sh so that you can execute it.
#!/bin/bash x=10 echo $x
To execute this program, just go to the shell prompt and type ./sample1.sh This should generate below output.
chmod +x sample1.sh
Web development and Automation testing