Open main menu

CDOT Wiki β

Changes

Tutorial10: Shell Scripting - Part 1

1 byte added, 09:06, 11 March 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'''. You need to 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 your shell script run?<br><br><span style="color:red;">'''ATTENTION:''' Students will get FRUSTRATED when performing their '''assignment 3''' when their Bash shell scripts have errors. One major cause is the the OUTPUT of their Bash shell script when run does not '''EXACTLY match''' the required output for the correct Bash shell script. This requires that you CAREFULLY '''read''' the requirements of your Bash shell script and create it to the EXACT specifications</span><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/myscripts/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>
13,420
edits