Changes

Jump to: navigation, search

Tutorial10: Shell Scripting - Part 1

380 bytes added, 10:00, 17 February 2021
INVESTIGATION 1: CREATING A SHELL SCRIPT
# Issue the following linux command to run your shell script in your current directory:<br><span style="color:blue;font-weight:bold;font-family:courier;">./hello</span><br><br>You should notice an error indicating you don't have permissions to run the file.<br>You need to first add execute permissions prior to running the shell script.<br><br>
# Issue the following linux command to add execute permissions for your shell script:<br><span style="color:blue;font-weight:bold;font-family:courier;">chmod u+x hello</span><br><br>
# Re-run your shell script: <span style="color:blue;font-weight:bold;font-family:courier;">./hello</span><br><br>Did you shell script run?<br><br># Issue the following Linux command to run a checking script:<br><span style="color:blue;font-weight:bold;font-family:courier;">bash /home/murray.saul/scripts/week10-check-1</span><br><br># If you encounter errors, make corrections and '''re-run''' the checking script until you<br>receive a congratulations message, then you can proceed.<br><br>
::In the next investigation, you will learn to create and run shell scripts that<br >use variables, positional and special parameters. You will also learn<br>how to add a '''she-bang line''' at the top of a shell script to force it to run in a specified shell.<br><br>
13,420
edits

Navigation menu