Changes

Jump to: navigation, search

Tutorial10: Shell Scripting - Part 1

882 bytes added, 09:53, 3 March 2021
INVESTIGATION 3: COMMAND SUBSTITUTION / MATH OPERATIONS
# Confirm that you are located in your '''home''' directory in your Matrix account.<br><br>
# Use a text editor to create a Bash shell script called '''command-substitution.bash'''<br><br>
# Add the following lines to the beginning of this file:<br><span style="font-family:courier;">#!/bin/bash<br>echo "MY ACCOUNT INFORMATION:"<br>echo<br>echo "Username: $(whoami)<br>echo<br>echo "Current Directory: $(pwd)"<br>echo<br>echo "Number of files in current directory: $(ls | wc -1)"<br>echo<br></span><br><br>
# Save your editing changes and exit your text editor.<br><br>
# Issue the '''chmod''' command to add execute permissions for the user for the '''command-substitution.bash''' file.<br><br>
# Issue the following to run the user-variables.bash Bash shell script:<br><span style="color:blue;font-weight:bold;font-family:courier;">./command-substitution.bash</span><br><br>Confirm that your shell script displays the correct information for your Matrix account.<br><br>
=INVESTIGATION 4: USING CONTROL FLOW STATEMENTS =
13,420
edits

Navigation menu