Mailing-List: contact cygwin-help@cygwin.com; run by ezmlm
List-Subscribe: <mailto:cygwin-subscribe@cygwin.com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin@cygwin.com>
List-Help: <mailto:cygwin-help@cygwin.com>, <http://sourceware.org/ml/#faqs>
Sender: cygwin-owner@cygwin.com
Mail-Followup-To: cygwin@cygwin.com
Delivered-To: mailing list cygwin@cygwin.com
To: cygwin@cygwin.com
From: zzapper <david@tvis.co.uk>
Subject: Re: Using PWD
Date: Sun, 06 Feb 2005 21:58:33 +0000
Lines: 27
Message-ID: <dm4d015n104foageh09p4o7lidfevuup9m@4ax.com>
References: <000701c50c70$37411610$713d480c@arthurfxgimkdx>
Mime-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
X-Complaints-To: usenet@sea.gmane.org
X-Gmane-NNTP-Posting-Host: 241.119-84-212.ippool.ndo.com
X-Newsreader: Forte Free Agent 2.0/32.652
X-Gmane-MailScanner: Found to be clean
X-Gmane-MailScanner: Found to be clean
X-MailScanner-From: goc-cygwin@m.gmane.org
X-MailScanner-To: cygwin@cygwin.com
X-IsSubscribed: yes

On Sun, 6 Feb 2005 09:20:53 -0800,  wrote:

>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
>
Art,
unless I'm missing something you want

which -a your_script


zzapper (vim, cygwin, wiki & zsh)
--

vim -c ":%s%s*%CyrnfrTfcbafbeROenzSZbbyranne%|:%s)[R-T]) )Ig|:norm G1VGg?"

http://www.vim.org/tips/tip.php?tip_id=305  Best of Vim Tips


--
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/

