Re: [Way OT] "#!/bin/bash" changes working directory
On Thu, 5 Jan 2006 14:25:10 -0500
Luis Finotti <email@example.com> wrote:
> Dear all,
> I realize that this should be "way off topic", so sorry about that...
> I've been working on a bash script, but when I run something like:
> echo $(pwd)
> I always get $HOME, not the current working directory. I'd need to
> continue in the working directory from where the script was called to
> work on the files there. (I'd like it to be portable too, so although
> it seems to work in my home machine running sarge, it doesn't work
> with Fedora or OSX...)
> I look at my "Classic Shell Scripting" book and glanced over the
> "Advanced Bash-Scripting Guide" (by Mendel Cooper), but could not find
> any reference to this. Any help would be greatly appreciated!
> Best to all,
> P.S.: feel free to CC me back.