#!/bin/sh
for i in bob bill sue mary; do
if [ -f /home/$i/.netscape ] ; then
echo "$i is a user of netscape"
else
echo "$i has never used netscape"
fi
done
root::0:0:root:/:/bin/bash bilbo::100:100:Bilbo Baggins:/home/bilbo:/bin/bash fred::101:100:Fred Bloggs:/home/fred:/bin/bash
cut -d : -f 1 /etc/passwd
root bilbo fred
#!/bin/sh
for i in ‘cut -d : -f 1 /etc/passwd‘ ; do
if [ -f /home/$i/.netscape ] ; then
echo "$i is a user of netscape"
else
echo "$i has never used netscape"
fi
done
#!/usr/bin/perl
@users = ‘cut -d : -f 1 /etc/passwd‘;
foreach $user (@users) {
chop($user); # removes newline
if (-f "/home/$user/.netscape") {
print "$user uses netscape0 ;
}
}
#!/usr/bin/python print ’hello world’
#!/usr/bin/python from Tkinter import * w = Button(text="hello world", command=’exit’) w.pack() w.mainloop()
# here we run the cvs tests at 8:00 in the morning # 00 08 * * * /usr/local/bin/runcvstests # # here we remind the non Windows users to change # their password. # 00 00 28 * * /usr/local/bin/mailfred
# MIN HOUR DAY MONTH DAYOFWEEK COMMAND # at 6:10 a.m. every day 10 6 * * * date # at 11:00 a.m. on the 4th and on every # mon, tue, wed 0 11 4 * mon-wed date # 4:00 a.m. on january 1st 0 4 1 jan * date
#!/bin/sh
#
# mailfred
# (Should be run by cron once a month)
#
# generateMessage
#
function generateMessage () {
cat << EOFEOF | mail -s "**** a \
warning for Ludites ****" $1
Cron is sending you a message.
Remember to log into Windows and choose
another password.
EOFEOF
}
generateMessage fred
#!/usr/bin/python print ’hello world’
chmod 755 hello.py
./hello.py
#!/usr/bin/python from Tkinter import * w = Button(text="hello world", command=’exit’) w.pack() w.mainloop()
This document was produced using groff-1.19.