Re: How do I determine the home directory of a shell script from ?within the script
- From: Tim Bradshaw <tfb+google@xxxxxxxx>
- Date: Fri, 16 Nov 2007 03:42:14 -0800 (PST)
On Nov 15, 4:31 pm, ddun...@xxxxxxxx (Darren Dunham) wrote:
That's because you have all absolute components in your path, or you are
providing an absolute filename for execution. Neither of those have to
be true.
$ PATH=.:$PATH
$ cd /tmp
$ foo.sh
./foo.sh
$ ./foo.sh
./foo.sh
That's true (though people with relative pathnames in their PATH
deserve to be melted down). You need to check for a relative $0 and
merge it with the current dir in that case.
.
- Follow-Ups:
- Re: How do I determine the home directory of a shell script from ?within the script
- From: Kjetil Torgrim Homme
- Re: How do I determine the home directory of a shell script from ?within the script
- References:
- How do I determine the home directory of a shell script from within the script
- From: patricko0317@xxxxxxxxx
- Re: How do I determine the home directory of a shell script from within the script
- From: Tim Bradshaw
- Re: How do I determine the home directory of a shell script from ?within the script
- From: Darren Dunham
- How do I determine the home directory of a shell script from within the script
- Prev by Date: Redudant parts
- Next by Date: Broken pipe on Solaris 8
- Previous by thread: Re: How do I determine the home directory of a shell script from ?within the script
- Next by thread: Re: How do I determine the home directory of a shell script from ?within the script
- Index(es):