« Return to Thread: Arriving at a specified directory instead of the user's home

Re: Arriving at a specified directory instead of the user's home

by Greg Wooledge :: Rate this Message:

Reply (Restricted by the Administrator) | Reply to Author | View in Thread

On Mon, Mar 12, 2007 at 07:03:55PM +0000, Robin Green wrote:
> # Find out the user's preferred shell and execute it
> exec `getent passwd $USER|sed -e 's|.*:\(.*\)$|\1|'`

$USER is far, far less standard than $LOGNAME.  Also, getent(1) is only
present on a very small cross-section of unix-like systems.

Why not simply use $SHELL?

 « Return to Thread: Arriving at a specified directory instead of the user's home