Path: utzoo!mnetor!uunet!mcvax!jaap From: jaap@cwi.nl (Jaap Akkerhuis) Newsgroups: comp.unix.wizards Subject: Re: What looks at the passwd file? Message-ID: <457@sering.cwi.nl> Date: 25 Mar 88 15:34:39 GMT References: <4739@aw.sei.cmu.edu> Organization: CWI, Amsterdam Lines: 31 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