pdb@sei.cmu.edu (Patrick Barron) (03/25/88)
Does anyone know if any of the "standard" Unix utilites look at the passwd file to determine your home directory, instead of looking at $HOME? (except, of course, authenication programs like login and su, which have to.) How about other commonly used non-standard software (e.g., Gnu Emacs, MH, etc.). I'm referring to 4.2/4.3BSD derived systems here. Thanks, --Pat.
jaap@cwi.nl (Jaap Akkerhuis) (03/25/88)
In article <4739@aw.sei.cmu.edu> pdb@sei.cmu.edu (Patrick Barron) writes: > > Does anyone know if any of the "standard" Unix utilites look at the passwd > file to determine your home directory, instead of looking at $HOME? (except, > of course, authenication programs like login and su, which have to.) How > about other commonly used non-standard software (e.g., Gnu Emacs, MH, etc.). > > I'm referring to 4.2/4.3BSD derived systems here. > > Thanks, > --Pat. Trivial, see next bundle, jaap # To unbundle, sh this file echo phd.sh 1>&2 sed 's/.//' >phd.sh <<'//GO.SYSIN DD phd.sh' -#!/bin/sh -# -# print home directory -# - -if [ $# = 0 ] -then - echo $HOME -else - grep "^${1}:" /etc/passwd | sed -e 's/.*:.*:.*:.*:.*:\(.*\):.*/\1/' -fi //GO.SYSIN DD phd.sh
rbj@icst-cmr.arpa (Root Boy Jim) (03/29/88)
People from Local 12, the Villians, Thieves, and Scoundrels Union :-) (Root Boy) Jim Cottrell <rbj@icst-cmr.arpa> National Bureau of Standards Flamer's Hotline: (301) 975-5688 I hope you millionaires are having fun! I just invested half your life savings in yeast!! P.S. That should produce some dough :-)