Question: Bash programming 1 . Write a script to read in three numbers as arguments, compare them, and list them in an ascending order. $ ex
Bash programming
Write a script to read in three numbers as arguments, compare them, and list
them in an ascending order.
$ ex
Write a command menu as follows:
$ ex
Command Menu
a Current date and time
b Users currently logged in
c Name of the working directory
d Contents of the working directory
Enter a b c or d:
The function for each selection is as indicated in the menu.
Write a script to read in an odd number n as an argument and calculate
the arithmetic summation n
hint: Use the looping statement.
$ ex
The sum is
Write a script to read in a number n as an argument and calculate its factorial
n where n n x n x n
$ ex
Factorial is
Write a script to back up multiple files into a directory, create the directory if the
directory doesn't exist, and display the message indicating the number of files has
been successfully backed up The last argument to the script is the directory.
$ ls
foo foo foo foo foo foo
$ ex progs
The directory progs is created.
files have been backed up into the directory progs.
$ ls
foo foo foo foo foo foo progs
$ ls progs
foo foo foo foo foo foo
Write a script to read in at least ten scores, sorts them, prints them out in an
descending order, and calculate their sum and average.
$ ex
Input scores:
Ordered scores:
The sum of all the scores is
The average is
Write a command menu as follows:
$ ex
Command Menu
a Enter a welcome message and write this message to a file msg
b Send the contents of the file msg to all users who are logged in
Enter a b :
The function for each selection is as indicated in the menu.
hint: b Use the mail command. For example, mail username msg
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
