Changes

Jump to: navigation, search

Tutorial10: Shell Scripting - Part 1

9 bytes removed, 15:45, 17 February 2021
INVESTIGATION 3: USING CONTROL FLOW STATEMENTS
# Save your editing session and exit the text editor (eg. with vi: press '''ESC''', then type ''':wx''' followed by '''ENTER''').<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 for-2.bash</span><br><br>
# Run your shell script by issuing: <span style="color:blue;font-weight:bold;font-family:courier;">./for-2.bash 10 9 8 7 6 5 4 3 2 1</span><br><br>How does this differ from the previous shell script?<br><br>You will learn in a couple of weeks more examples of using loop statements.<br><br>Let's run a '''checking-script''' to confirm that both your '''for-1.bash''' and '''for-2.bash'''<br>Bash shell scripts exist, have execute permissions, and when run, produce <br>the same expected OUTPUT<br>as required in this tutorial's instructions.<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-3 | more</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>Let's create a Bash shell script that contain '''user-created variables'''.<br><br>
13,420
edits

Navigation menu