Re: Finding absolute path of a script from within
On Mar 14, 5:45 pm, Florian Kaufmann <sensor...@gmail.com> wrote:
> > where_am_i=$((cd $(dirname $0) && pwd))
>
> > Or is there any other/easier way?
>
> How about
>
> where_am_i=$(dirname $0)
Yeah, that's what I initially tried in my script. If my script is
executed like
../my_script
OR like
.../../dir/myscript
where_am_i will only contain "." and "../../dir" respectively which
are not absolute
|