Changes

Jump to: navigation, search

Tutorial10: Shell Scripting - Part 1

404 bytes added, 07:41, 18 July 2020
INVESTIGATION 1: CREATING A SHELL SCRIPT
# Enter the following two lines in your shell script, replacing "your name" with your actual name:<br><span style="font-family:courier;">clear<br>echo "Hello Your Name"</span><br><br>
# 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 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>You should now see your screen clear and displays a greeting to you using your name.<br><br># x
13,420
edits

Navigation menu