[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Determinate the directory whithin a script

The command with which the skript was invoked is stored in $0. That might be 
what you need.

Am Sonntag, 18. Juni 2006 19:45 schrieb Paolo Pantaleo:
> I have a script in something like
> /media/sda1/backup/script.sh
> since sda1 could be also sda2 or anything, I want to determintate at
> run-time what is the directory in which the script is located, how can
> I do?
> pwd doesn't work, since I cuold call the script from some other direcotry
> Thnx
> PAolo
> --
> if you have a minute to spend please visit my photogrphy site:
> http://mypic.co.nr

Reply to: