From mboxrd@z Thu Jan 1 00:00:00 1970 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: fee84,5ce8f07a6a06dc57 X-Google-Attributes: gidfee84,public X-Google-ArrivalTime: 1994-12-06 10:35:52 PST Newsgroups: comp.unix.osf.osf1 Path: bga.com!news.sprintlink.net!howland.reston.ans.net!darwin.sura.net!news.sesqui.net!uuneo.neosoft.com!nmtigw!peter From: peter@nmti.com (Peter da Silva) Subject: Re: Updating .profile en masse Message-ID: Sender: peter@nmti.com (peter da silva) Organization: Network/development platform support, NMTI References: <3bvrlg$ruq@mustang.smcvt.edu> Date: Tue, 6 Dec 1994 18:20:50 GMT In article <3bvrlg$ruq@mustang.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... 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?"