Question: 1 #!/bin/bash 2 if [ $# != 1 ] 3 then 4 echo Usage: $0 userid 5 exit 1 6 fi 7 count=ps ax -0

 1 #!/bin/bash 2 if [ $# != 1 ] 3 then

1 #!/bin/bash 2 if [ $# != 1 ] 3 then 4 echo "Usage: $0 userid" 5 exit 1 6 fi 7 count=ps ax -0 user | grep - $1' && [[ $count -ne o ]] && echo "$1 has processes 3. You will now modify the script that you created in Question 2 by using an if-then-else statement instead of the command line-list. The if-then-else statement should determine if there is any processed associated with the userid supplied as a parameter. The script should display a message if there were any processes for the userid, or another message if there were no processes for the userid. Name this script Q3.sh Remember to make your script executable Use the following for the condition in your if-then-else statement (be sure that you understand what this is doing): [ $ (ps a -o user | grep -c $1 ) -gt 0 ] Here's a screenshot of the script in use: whiten1@ubuntuGold :-/Assignments/Assignment7$ ./Q3.sh Usage: ./03.sh userid whiten1@ubuntuGold:~/Assignments/Assignment7$ ./Q3.sh root root has processes whiten1@ubuntuGold:-/Assignments/Assignment7$ ./03.sh rootie rootie has no processes whiten1@ubuntuGold:-/Assignments/Assignment7$ 1

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 Databases Questions!