cvs commit: src/bin/sh main.c

John Baldwin jhb at freebsd.org
Mon Jun 11 18:22:29 UTC 2007


On Saturday 04 February 2006 09:47:19 am Jens Schweikhardt wrote:
> schweikh    2006-02-04 14:47:19 UTC
> 
>   FreeBSD src repository
> 
>   Modified files:
>     bin/sh               main.c 
>   Log:
>   Initialize PWD early on (don't expect it to be inherited from the
>   environment or set it only when changing directories with cd).
>   
>   PR:     standards/92640
>   
>   Revision  Changes    Path
>   1.27      +2 -0      src/bin/sh/main.c

I just recently updated my system to contain this and it has broken all 
my /bin/sh shell scripts that use p4 which is highly annoying.  Specifically, 
I use the default freebsd layout of:

/home -> /usr/home

and

/home/jhb as my homedir in the password file.  I also use tcsh as my login 
shell.  tcsh understands that it starts out in /home/jhb without issue, but 
exec'ing sh rewrites $PWD which in turn confuses p4 since it uses $PWD to 
figure out if a path is under the client path.  Can we at least have an 
option to turn this off?
                                                                                
[14:18:58] (ttyp7) jhb at mutex:~
> echo $PWD
/home/jhb
                                                                                
[14:19:05] (ttyp7) jhb at mutex:~
> sh
$ echo $PWD
/usr/home/jhb
$

Either that or I have to go hack all my scripts to rewrite $PWD. :(

-- 
John Baldwin


More information about the cvs-src mailing list