Build Bash Scripts Lab
You have learned to build Bash command-line tools. This exercise helps you master this concept.
Let's create a Bash Command Line Tool that accepts two arguments. The current example accepts two arguments --count
and --phrase
.
To run the command you get the following output:
./cli.sh --count 5 --phrase "hello world"
hello world
hello world
hello world
hello world
hello world
- Change the
--count
option to be named--number
. - Change the the
--phrase
option to be name--message
. - Rerun the command-line tool
- The
phrase_generator()
bash function prints out the phrase you entered as the second argument viaecho "$2"
. Change function so it will print out the phrase with the following appended to the front:You entered phrase:
.