|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
Stop making mediocre tutorials.The best tutorials are video! Camtasia Studio makes it easy to create engaging, buzz-building screen videos at any size, in any popular format. Download the free trial!
|
|
#1
|
|||
|
|||
|
ison script please look at
my friend has challenged me does anyone have any input
# Determine if someone is logged on # Version 4.0 if [ “$#” ne 1 ] then echo “ Incorrect number of arguments” echo “Usage: $ ison4 <user>” else user=“$1” if who | grep “$user” > /dev/null then echo “$user is logged on” else echo “$user is not logged on” fi fi shell program named ison that will check every 5 seconds whether a particular user has logged into the system. When the user logs in, print a message on your terminal flagging the login. (Make sure the user entered is a valid user.) (hint use ison5 Last edited by kim187 : May 1st, 2008 at 01:06 AM. Reason: vhange |
|
#2
|
|||
|
|||
|
It's a start, at least you got the first line correct... Here are some hints ( enclosed in [] ): Quote:
__________________
Last edited by LKBrwn_DBA : April 28th, 2008 at 03:03 PM. |
|
#3
|
|||
|
|||
|
cron has a minimum 'resolution' of 1 minute, so you'd need a loop with a sleep 5 to get close to 5 second gaps between checks.
__________________
"Do not meddle in the affairs of cats, for they are subtle and will pee on your computer" - Bruce Graham |
![]() |
| Viewing: Dev Shed Forums > Operating Systems > Linux Help > Need help for basic scripts.. guys |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|
|