delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2012/01/03/21:33:21

X-Recipient: archive-cygwin AT delorie DOT com
X-SWARE-Spam-Status: No, hits=0.3 required=5.0 tests=AWL,BAYES_00,FREEMAIL_FROM,RP_MATCHES_RCVD
X-Spam-Check-By: sourceware.org
Message-ID: <33076579.post@talk.nabble.com>
Date: Tue, 3 Jan 2012 18:32:55 -0800 (PST)
From: Radly <daryl AT daryllee DOT com>
To: cygwin AT cygwin DOT com
Subject: Combining path components
MIME-Version: 1.0
X-IsSubscribed: yes
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

I just installed Cygwin, which I've used off and on since it was created. 
I've been using MinGw for several months and have a .bashrc file that sets
up some environment variables for me to reduce the typing in some routine
tasks.  The file has the following form, after modifying the first line from
MinGw's format to Cygwin's:

export DD=/cygdrive/D/Common
export LL=$DD/labs

The intent is to make $LL refer to /cygdrive/D/Common/labs.  If I execute
those commands at the bash prompt, I get the desired effect:

"echo $LL" produces "/cygdrive/D/Common/labs"

But when I do
$ . .bashrc  (or ./.bashrc, either one)
$ echo $LL

I get
/labsrive/D/Common

instead of
/cygdrive/D/Common/labs

When I experiment with various paths for DD and LL, I see the following
pattern.  The beginning of the DD string is overwritten with the LL string. 
For instance, DD=/abcdef/ghi/jklmn; LL=/opqr yields $LL=/opqref/ghi/jklmn.

I don't get this behavior in any other Linux-ish installation I have: either
MinGw, OS X, or any of my Linuces.

Since bash is a GNU product, I'm sure this is a "feature".  So I only need
to know how to get what I want.

And I'm sure you'll ask: the output of "sh --version" includes "GNU bash,
version 4.1.10(4)-release (i686-pc-cygwin).


-- 
View this message in context: http://old.nabble.com/Combining-path-components-tp33076579p33076579.html
Sent from the Cygwin list mailing list archive at Nabble.com.


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

- Raw text -


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