Afficher un message
Vieux 14/03/2008, 14h55   #6
Jeenu
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut 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
  Réponse avec citation
 
Page generated in 0,04349 seconds with 9 queries