home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.unix.wizards
- Path: sparky!uunet!darwin.sura.net!mips!sdd.hp.com!usc!sol.ctr.columbia.edu!eff!news.oc.com!convex!tchrist
- From: Tom Christiansen <tchrist@convex.COM>
- Subject: Re: Making ``.plan'' EXECUTE a Program ???
- Message-ID: <1992Jul29.145537.3223@news.eng.convex.com>
- Originator: tchrist@pixel.convex.com
- Sender: usenet@news.eng.convex.com (news access account)
- Nntp-Posting-Host: pixel.convex.com
- Reply-To: tchrist@convex.COM (Tom Christiansen)
- Organization: CONVEX Realtime Development, Colorado Springs, CO
- References: <31567@adm.brl.mil> <#q61Hejis8@atlantis.psu.edu>
- Date: Wed, 29 Jul 1992 14:55:37 GMT
- X-Disclaimer: This message was written by a user at CONVEX Computer
- Corp. The opinions expressed are those of the user and
- not necessarily those of CONVEX.
- Lines: 45
-
- David Barr writes:
-
- :awk is your friend.
-
- Well this may be, but the csh most decidely is not.
-
- :foreach user (`/usr/bin/ypcat passwd | /usr/bin/egrep -v '^\+|ftp|demo' | awk -F: '{ print $1 }'`)
-
- On my system, I get:
-
- Too many words from ``.
-
- :no temp files, and it's got to be a heck of a lot faster than using ex
- :and files.
-
- If only it ran; it does take several processes too many, too.
-
- :set userlist=`/usr/bin/egrep -v '^\+|uucp|news|sync|' | awk ....`
- :set userlist="$userlist `/usr/bin/ypcat passwd | egrep ....`"
- :foreach user ($userlist)
-
- How about instead of Perry Hutchison's csh script, simply:
-
-
- #!/usr/bin/perl
- chop($host = `hostname`);
- for ('uucp', 'news', 'sync') { $skip{$_}++ }
- while (@pwent = getpwent()) {
- ($user, $home) = @pwent[0,7];
- next if $skip{$user};
- $rcfile = "$home/.boot.$host";
- next if $done{$rcfile};
- if (-f $rcfile) {
- system "su -f $user < $rcfile &";
- $done{$rcfile}++;
- }
- }
-
- --tom
-
- --
- Tom Christiansen tchrist@convex.com convex!tchrist
-
-
- "We don't care. We don't have to. We're the Phone Company."
-