Question: 1) Write a shell script called addtwo.sh to read in two numbers from the keyboard and print their sum. The output should consist of a
1) Write a shell script called addtwo.sh to read in two numbers from the keyboard and print their sum. The output should consist of a line showing the equation used to calculate the sum (e.g., 4 + 5 = 9). [Hint: see read, echo and let].
2) Write a shell script called logincount.sh that given a person's UID (User ID), tells you how many times that person is logged on. The output line should print out something like bschmidt is logged on 2 times. [Hint: see who, grep, and wc].
3) Write a shell script called lsdirs.sh that lists out, one line at a time, just the directories located in the current directory. [Hint: see set, test, and looping].
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
