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
From: "Dave Korn" <dk@artimi.com>
To: <cygwin@cygwin.com>
Subject: RE: if construct doesn't work in makefile
Date: Thu, 11 Nov 2004 13:02:25 -0000
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
In-Reply-To: <41934D94.6040407@familiehaase.de>
Message-ID: <NUTMEG4Rrnu2CCbJz9K00000685@NUTMEG.CAM.ARTIMI.COM>
X-OriginalArrivalTime: 11 Nov 2004 13:02:26.0046 (UTC) FILETIME=[B11761E0:01C4C7EE]

> -----Original Message-----
> From: cygwin-owner On Behalf Of Gerrit P. Haase
> Sent: 11 November 2004 11:32

> Prasad, Kanuparthi wrote:
> > Hi,
> > 
> >   In my make file I am trying to check whether a directory 
> exists or not
> > then set a path differently if doesn't exist.
> >   I am using cygwin installed on windows 2000.
> >   The if construct I have is as follows.
> > 
> >   if test [-dc:/tools]; then DRIVE = c:/tools; else DRIVE = 
> c:/altTools; fi
> > 
> >  pls help me out.
> 
> Try
> if test [-dc:/tools] ; then DRIVE=c:/tools; else DRIVE=c:/altTools; fi
> instead, and/or use cygwin syntax to access drives.

  There's nothing wrong with the command syntax in general.  The problem is that
in bash, you can't put a space between the VARIABLE and the = sign, or bash
thinks it's an executable to search the $PATH for instead of a variable to
assign to.


dk@mace /tmp/bgcc> unset FRED
dk@mace /tmp/bgcc> if test [-dc:/baar]; then FRED=yes; else FRED=no; fi
dk@mace /tmp/bgcc> echo ${FRED}
yes
dk@mace /tmp/bgcc> unset FRED
dk@mace /tmp/bgcc> if test [-dc:/baar]; then FRED = yes; else FRED = no; fi
bash: FRED: command not found
dk@mace /tmp/bgcc> if test [-dc:/baar]; then FRED =yes; else FRED =no; fi
bash: FRED: command not found
dk@mace /tmp/bgcc> if test [-dc:/baar]; then FRED=yes; else FRED =no; fi
dk@mace /tmp/bgcc>



    cheers, 
      DaveK
-- 
Can't think of a witty .sigline today....


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

