From: peter@nmti.com (Peter da Silva)
Subject: Re: Updating .profile en masse
Date: Tue, 6 Dec 1994 18:20:50 GMT [thread overview]
Message-ID: <id.0JCF1.H34@nmti.com> (raw)
In-Reply-To: 3bvrlg$ruq@mustang.smcvt.edu
In article <3bvrlg$ruq@mustang.smcvt.edu>,
Dave Goodwin <goodwin@smcvax.smcvt.edu> wrote:
> I'm showing my newbie status here, but we've not been on UNIX of any type
> for very long. I need to add a line to the .profile of all our users and
> am wondering if there's a quick way to do so? Thanks for the help...
Create two files:
line-for-dot-profile
line-for-dot-login
These contain the shell and csh versions of the line you want to add. Then
do this:
awk -F: '{print $6,$7}' /etc/passwd | while read directory shell
do
case $shell in
*csh) file=login;;
*) file=profile;;
esac
cat line-for-dot-$file >> $directory/.$file
done
--
Peter da Silva `-_-'
Network Management Technology Incorporated 'U`
1601 Industrial Blvd. Sugar Land, TX 77478 USA
+1 713 274 5180 "Hast Du heute schon Deinen Wolf umarmt?"
prev parent reply other threads:[~1994-12-06 18:20 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
1994-12-05 20:02 Updating .profile en masse Dave Goodwin
1994-12-06 6:12 ` Peter.Mayne
1994-12-06 18:20 ` Peter da Silva [this message]
read-only archive
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox