* Updating .profile en masse
@ 1994-12-05 20:02 Dave Goodwin
1994-12-06 6:12 ` Peter.Mayne
1994-12-06 18:20 ` Peter da Silva
0 siblings, 2 replies; 3+ messages in thread
From: Dave Goodwin @ 1994-12-05 20:02 UTC (permalink / raw)
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...
Dave
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: Updating .profile en masse
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
1 sibling, 0 replies; 3+ messages in thread
From: Peter.Mayne @ 1994-12-06 6:12 UTC (permalink / raw)
In article <3bvrlg$ruq@mustang.smcvt.edu>,
goodwin@smcvax.smcvt.edu (Dave Goodwin) 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...
>
> Dave
Use /etc/profile instead? From man sh (and similar in man ksh):
When you log in, the shell is called to read your commands. Before it does
that, however, it checks to see if a file named /etc/profile exists on the
system, and if it does, it reads commands from it (this file sets variables
needed by all users). After this, the shell looks for a file named .pro-
file in your login directory. If it finds one, it executes commands from
it. Finally, the shell is ready to read commands from your standard input.
PJDM
--
Peter Mayne | My statements, not Digital's.
Digital Equipment Corporation |
Canberra, ACT, Australia | "AXP!": Bill the Cat
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: Updating .profile en masse
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
1 sibling, 0 replies; 3+ messages in thread
From: Peter da Silva @ 1994-12-06 18:20 UTC (permalink / raw)
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?"
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~1994-12-06 18:20 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
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 is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox