Changes

Jump to: navigation, search

Tutorial10: Shell Scripting - Part 1

17 bytes added, 11:59, 3 March 2021
INVESTIGATION 2: USING VARIABLES IN SHELL SCRIPTS
# Confirm that you are located in your '''home''' directory in your Matrix account.<br><br>
# Use a text editor to edit the shell script called '''hello'''<br><br>
# Add the following line to the bottom of the file:<br><span style="font-family:courier;font-weight:bold;">echo "The current shell you are using is: $(ps -o cmd= -p $$|cut -d' ' -f1)"</span><br><br>'''NOTE:''' This command displays the '''name''' of the ''shell'' that the shell script<br>is running within. The command within '''$( )''' uses a technique known as "''command substitution''"<br>which you will learn about in '''week 12'''.<br><br>
# '''Save''' your editing changes and '''exit''' your text editor.<br><br>
# Issue the following linux command to change to the '''Bourne Shell''':<br><span style="color:blue;font-weight:bold;font-family:courier;">sh</span><br><br>You should notice your shell prompt change indicating you are in a different shell.<br><br>
13,420
edits

Navigation menu