[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: [Way OT] "#!/bin/bash" changes working directory



On Thursday 05 January 2006 13:16, Luis Finotti wrote:
> I have
>
> -------------------------------
>   AUTOHOME=$PWD
>
>   # Clean up stupid automounter directory
>   case $PWD in
>         $AUTOHOME*) cd $HOME${PWD#$AUTOHOME} ;;
>   esac
>   PS1='\h[\w]% '
> ---------------------------------
>
> To be honest, I had this for 10 years and never thought about it.
>
> In any case, is there a way to avoid the change.  I'd like the script
> to work even if someone also has something like that...

Well, this certainly appears to be your problem. 

What exactly are you trying to accomplish with this snippet? It certainly 
doesn't look like a normal thing to do.

Also, do you have the same problem if you use #!/bin/sh instead of 
#!/bin/bash? You mentioned wanting to be portable, so that's a good idea 
anyway.

-- 
Wesley J. Landaker <wjl@icecavern.net> <xmpp:wjl@icecavern.net>
OpenPGP FP: 4135 2A3B 4726 ACC5 9094  0097 F0A9 8A4C 4CD6 E3D2

Attachment: pgp1pdTeLZNEF.pgp
Description: PGP signature


Reply to: