Question
1. In this task, you will create a script called positional.sh that accepts the output of the date command and performs some formatting. Example solution;
1. In this task, you will create a script called positional.sh that accepts the output of the date command and performs some formatting.
Example solution;
cjingers@general:~$ ./positional.sh `date` Fri Jan 11 14:15:00 DST 2019 Today is Friday, the 11 of January 2019
- The positional parameters of your command are populated with the date command as shown in the example - Display a list of the parameters - Display the message; Today is
2. Create a script named math.sh that performs the following actions;
- Accepts two integers as inputs - Calculate the value of the first parameter raised to the power of the second parameter - print the first and second parameters - print the solution Example;
cjingers@general:~$ ./math.sh 2 4 2 4 16
3. Create a script named io.sh that performs the following tasks;
- Accepts a name and 3 integers as arguments - Calculate the average of the three numbers - Output the data in a table format as shown in the example below Example
cjingers@general:~$ ./io.sh "Bob" 12 14 15 Name 1st 2nd 3rd Average Bob 12 14 15 13 Remember to include the #! line in your submission.
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started