{[ promptMessage ]}

Bookmark it

{[ promptMessage ]}

ExamplesOS+Sol - svn and exits When the script receives the...

Info icon This preview shows pages 1–2. Sign up to view the full content.

View Full Document Right Arrow Icon
Example of solutions 1. Command w displays all user that are logged to the system, and produces some information related to their activity. An example of command w output is the following: 19:07:39 up 1 day, 8:19, 2 users, load average: 0.00, 0.12, 0.21 USER TTY FROM [email protected] IDLE JCPU PCPU WHAT laface pts/0 :0.0 18:58 9:14m 0.16s 0.16s bash laface pts/1 :0.0 18:58 0.00s 0.26s 0.03s w Implement an shell script that that takes one parameter form the input line, in the format of the LOGIN time, analyzes the command w output, and displays to the administrator all users that have logged at that time, and the names of their processes. example of solution : #!/bin/bash w | tr -s " " | cut -f 1,4,8 -d ' ' | tail -n +3 | grep $1 | cut -f 1,3 -d ' ' 2. Implement a shell script ( runsvn.sh ) that takes one parameter from the input line. The parameter can only assume the start or stop . When the script receives the parameter start it executes in background the program
Image of page 1

Info icon This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document Right Arrow Icon