Question: Bash scripting PART 1 : You will create a script that demonstrates various scripting concepts, including echoing text, using variables, and displaying built - in

Bash scripting
PART 1: You will create a script that demonstrates various scripting concepts, including echoing text, using variables, and displaying built-in variables.
The script needs to do the following:
Display "Scripting is fun !"
Define two variables: variable1 with the value "Hello" and variable2 with the value "Bash".
Create a greeting using the defined variables and echo it with the message "Hello, welcome to the world of Bash scripting!".
Use built-in variables to display:
Your current bash path
The Bash version you are using
The PID of the bash process
Your home directory
Your current working directory
Your hostname
PART 2:
Write a script that will count how many executable commands are in your current PATH. The script needs to count the number of executable files rather than just number of files. When finished, it needs to display number of commands and nonexecutables are in the default PATH .
Here is the output from my machine (Mac):
adi_z$ ./count_commands.sh
1436 commands, and 8 entries that weren't executable
PART 3:
In this part you will write a Bash script that simulates a simple calculator. The script needs to have a function called MY_CALC that can process user input such as this:
1 plus 4
8 minus 1
2 times 5
6 divided-by 4

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!