This is the mail archive of the cygwin mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Using PWD


I'm trying to find the directory of an executing bash script and am having
very limited success. For example(s):

1. <path>/script.sh
2. source <path>/script.sh
3. bash <path>/script.sh

I can find the correct <path> only for the first example (dirname $0). PWD
(of course) only works when <path> == ./. The other two cases I can't seem
to get to work. Any idea how to get the <path> in examples 2 and 3?

art


--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Problem reports:       http://cygwin.com/problems.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]