Re: shell: full path to currently executed script
- From: "Angel Tsankov" <fn42551@xxxxxxxxxxxxxxxx>
- Date: Fri, 19 May 2006 00:13:36 +0300
"Chris F.A. Johnson" <cfajohnson@xxxxxxxxx> wrote in message news:so3vj3-um8.ln1@xxxxxxxxxxxxxxxxxxxxx
On 2006-05-18, Angel Tsankov wrote:How can I obtain the full path to the currently executed script?
Why? There is generally no good reason to do that.
However, it is usally in $0.
Well, $0 does not always give the full path. Consider this:
echo 'echo "$0"' > a
chmod 700 a
pwd
stdout: /root
./a
stdout:./a
I need the last command to print /root/a, not ./a
I repeat: why do you need it? There is almost always a better way
to do whatever you really want to do.
I want to copy the files that reside in the same folder as the script to let's say /copy
.
- Follow-Ups:
- Re: shell: full path to currently executed script
- From: Chris Davies
- Re: shell: full path to currently executed script
- From: Angel Tsankov
- Re: shell: full path to currently executed script
- From: Dan Espen
- Re: shell: full path to currently executed script
- From: Chris F.A. Johnson
- Re: shell: full path to currently executed script
- From: Unruh
- Re: shell: full path to currently executed script
- References:
- shell: full path to currently executed script
- From: Angel Tsankov
- Re: shell: full path to currently executed script
- From: Chris F.A. Johnson
- Re: shell: full path to currently executed script
- From: Angel Tsankov
- Re: shell: full path to currently executed script
- From: Chris F.A. Johnson
- shell: full path to currently executed script
- Prev by Date: Re: shell: full path to currently executed script
- Next by Date: Re: shell: full path to currently executed script
- Previous by thread: Re: shell: full path to currently executed script
- Next by thread: Re: shell: full path to currently executed script
- Index(es):
Relevant Pages
|