delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/1997/09/02/02:06:20

From: jeffdbREMOVETHIS AT netzone DOT com (Mikey)
Subject: Re: Problems with shell script (bash)
2 Sep 1997 02:06:20 -0700 :
Sender: mail AT cygnus DOT com
Approved: cygnus DOT gnu-win32 AT cygnus DOT com
Distribution: cygnus
Message-ID: <340a190c.9585574.cygnus.gnu-win32@smtp.netzone.com>
References: <199708281923 DOT MAA17886 AT rx7 DOT connectinc DOT com>
Reply-To: jeffdbREMOVETHIS AT netzone DOT com
Original-To: yung AT pobox DOT com (Yung Hsien), gnu-win32 AT cygnus DOT com
In-Reply-To: <199708281923.MAA17886@rx7.connectinc.com>
X-Mailer: Forte Agent 1.01/32.397
MIME-Version: 1.0
Original-Sender: owner-gnu-win32 AT cygnus DOT com

To see what's going on in a bash script do

set -xv

../scriptname

set +xv

On Thu, 28 Aug 1997 12:23:50 -0700, you wrote:

>Hello,
>
>I'm having a problem with bash, tr, or echo... I'm not sure who the culprit
>is here. In any case, here's a short script:
>
>>#!/bin/sh
>>
>>OPTIONS="A B C"
>>
>>FOUND="FALSE"
>>FIND=`echo a | tr '[a-z]' '[A-Z]'`
>>
>>echo $FIND
>>
>>for opt in $OPTIONS ; do
>>  if [ $opt = $FIND ] ; then
>>    FOUND="TRUE"
>>  fi
>>done
>>
>>echo $FOUND
>>
>
>What it should echo at the end is TRUE since 'A' is in "A B C".
>But it echos FALSE. Note, that this works on my UNIX box. Also, if I say
>FIND=`echo A | tr '[a-z'] '[A-Z]'` that fails also.
>
>Thanks,
>Yung Hsien
>yung AT connectinc DOT com
>
>-
>For help on using this list (especially unsubscribing), send a message to
>"gnu-win32-request AT cygnus DOT com" with one line of text: "help".
>

(jeffdbREMOVETHIS AT netzone DOT com)
delete REMOVETHIS from the above to reply
         Mikey
-
For help on using this list (especially unsubscribing), send a message to
"gnu-win32-request AT cygnus DOT com" with one line of text: "help".

- Raw text -


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