delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2008/04/11/04:22:23

X-Recipient: archive-cygwin AT delorie DOT com
X-Spam-Check-By: sourceware.org
MIME-Version: 1.0
Subject: Reg: dirname
Date: Fri, 11 Apr 2008 13:51:37 +0530
Message-ID: <F2E4114B3DEA464390B27AC89E7DE2CB021AD0DF@IN01WEMBX1.internal.synopsys.com>
From: "Manjunatha Appaji Gowda" <Manjunatha DOT A AT synopsys DOT com>
To: <cygwin AT cygwin DOT com>
Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Id: <cygwin.cygwin.com>
List-Subscribe: <mailto:cygwin-subscribe AT cygwin DOT com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-help AT cygwin DOT com>, <http://sourceware.org/ml/#faqs>
Sender: cygwin-owner AT cygwin DOT com
Mail-Followup-To: cygwin AT cygwin DOT com
Delivered-To: mailing list cygwin AT cygwin DOT com
X-MIME-Autoconverted: from quoted-printable to 8bit by delorie.com id m3B8MMM5027179

Hi all,

i have some problem with $0

for example my script looks like this

#!/bin/sh

echo `dirname "$0"`

i m keeping this script in this path c:/users/test/script

if i do

 sh -x c:/users/test/script from cygwin (bash shell)

ideally results should look like in below

$ sh -x c:/users/test/test
++ dirname c:/users/test/test
+ echo c:/users/test/
c:/users/test/

for some reason in some machines results are showing like in below

$ sh -x c:/users/test/test
++ dirname /cygdrive/c/users/test/test
+ echo /cygdrive/c/users/test
/cygdrive/c/users/test

please help on this

Manjunath

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


- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019