Computing.Net > Forums > Unix > Newbie needs help with 1st scripts

Newbie needs help with 1st scripts

Reply to Message Icon

Original Message
Name: Acoustic
Date: November 29, 2006 at 05:11:53 Pacific
Subject: Newbie needs help with 1st scripts
OS: Solaris 5.8
CPU/Ram: ?
Model/Manufacturer: ?
Comment:

Hi I'm quite new with scripting and am having a few problems with even the simpleist things. I am trying to create a script that will tell me all users on my system that haven't logged in for 6 months. This is what i've got at the moment as a start but this isn't working and it is the easy bit. The list of user names and directory are listed below the script.

while
read uname hdir
do
if echo $hdir | grep '^/home/' > /dev/null
then
last -n 1 $uname > lastlogin
sleep 5
fi
done

Please let me know what i'm doing wrong.


Thanks in advance for your help.


Report Offensive Message For Removal








Use following form to reply to current message:

   Name: From My Computing.Net Settings
 E-Mail: From My Computing.Net Settings

Subject: Newbie needs help with 1st scripts

Comments:

 


  Homepage URL (*): 
Homepage Title (*): 
         Image URL: 
 
Data Recovery Software




How often do you use Computing.Net?

Every Day
Once a Week
Once a Month
This Is My First Time!


View Results

Poll Finishes In 4 Days.
Discuss in The Lounge