Re: OT: bash question

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

 



On Mon, Jan 31, 2011 at 12:32 PM, Mike Wright
<mike.wright@xxxxxxxxxxxxxx> wrote:
> s there a bash command that tells an executing script what *its* path
> is?  Not the path where the user is but where the script is.

$ cat ./test.sh
#!/bin/bash

echo $0 is the script
echo `dirname $0` is the script location

exit $?

HTH

-- 
Suvayu

Open source is the future. It sets us free.
-- 
users mailing list
users@xxxxxxxxxxxxxxxxxxxxxxx
To unsubscribe or change subscription options:
https://admin.fedoraproject.org/mailman/listinfo/users
Guidelines: http://fedoraproject.org/wiki/Mailing_list_guidelines



[Index of Archives]     [Current Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Yosemite News]     [Yosemite Photos]     [KDE Users]     [Fedora Tools]     [Fedora Docs]

  Powered by Linux