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

Computer Problems? Computing.Net has over 1,000,000 posts about all things technology related! Over 90% answered within 24 hours! Click here to start participating now! Also, be sure to check out the New User Guide.

Newbie needs help with 1st scripts

Reply to Message Icon

Name: Acoustic
Date: November 29, 2006 at 05:11:53 Pacific
OS: Solaris 5.8
CPU/Ram: ?
Product: ?
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.



Sponsored Link
Ads by Google
Reply to Message Icon

Related Posts

See More







Post Locked

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.


Go to Unix Forum Home


Sponsored links

Ads by Google


Results for: Newbie needs help with 1st scripts

need help with unix script www.computing.net/answers/unix/need-help-with-unix-script/8209.html

Need Help with KornShell script www.computing.net/answers/unix/need-help-with-kornshell-script/5978.html

Need Help With KSH Script www.computing.net/answers/unix/need-help-with-ksh-script/6747.html