delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2019/02/21/16:47:10

X-Recipient: archive-cygwin AT delorie DOT com
DomainKey-Signature: a=rsa-sha1; c=nofws; d=sourceware.org; h=list-id
:list-unsubscribe:list-subscribe:list-archive:list-post
:list-help:sender:reply-to:subject:to:references:from:message-id
:date:mime-version:in-reply-to:content-type
:content-transfer-encoding; q=dns; s=default; b=i3oBewrrj86CIP+y
YtGnMqfmfrfd8cYZoTOBQ9vGq0YmoyfKmYJ3Z7FIIxdOKzS3XChEsvKcmTmiSoh7
D73P+0TD7vBQSK04wewNwzi1tGRUhNmx7YmOxdJ0HazLnAE0nJ8KLf21jLe/w6tb
CpX5Nqe6mg+r4/Q6G4arIdbv7kM=
DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=sourceware.org; h=list-id
:list-unsubscribe:list-subscribe:list-archive:list-post
:list-help:sender:reply-to:subject:to:references:from:message-id
:date:mime-version:in-reply-to:content-type
:content-transfer-encoding; s=default; bh=cipJQbu722OYeAwSb5L9ZB
X1WUc=; b=DGwKkrM+4BS++F7qMo1NgxXxfknsD8rSbVOC4X0p/JLRZJZARQRZGo
VilEJ/92k+8uTk7HiUcLxl3QPt8fEMoueto/vmvO4rFD6CGg24s+8ilUhZN1gUS7
vPrjIdYQYd6n33YbXl+Bpx/f9cWAYNNTI2XaJyIyY7xiAfPIXHaPU=
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
Authentication-Results: sourceware.org; auth=none
X-Spam-SWARE-Status: No, score=-1.9 required=5.0 tests=BAYES_00,SPF_PASS autolearn=ham version=3.3.2 spammy=eliot, Moss, moss, H*Ad:D*edu
X-HELO: mailsrv.cs.umass.edu
Reply-To: moss AT cs DOT umass DOT edu
Subject: Re: bash string-operator problem
To: cygwin AT cygwin DOT com
References: <d846545ebaa5469d90f01f84e4f48c3d AT vsrv060ex01 DOT ssd DOT fsi DOT com> <CAD8GWsvqXdG-2YvmVAqW=jkZ_ejHGOj=LCemjoqkF08Vy7i=Fw AT mail DOT gmail DOT com> <608a0fe0-a1eb-6c13-8a6e-0074dcbc166c AT mail DOT com> <CAD8GWsvUBHrbTNxE1RA1gtUhXCD3tD6BgUuPBX_DWJDwHOafDg AT mail DOT gmail DOT com>
From: Eliot Moss <moss AT cs DOT umass DOT edu>
Message-ID: <0c5cbf74-f9a3-2caf-d32d-46558ece3362@cs.umass.edu>
Date: Thu, 21 Feb 2019 16:46:52 -0500
User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:60.0) Gecko/20100101 Thunderbird/60.5.0
MIME-Version: 1.0
In-Reply-To: <CAD8GWsvUBHrbTNxE1RA1gtUhXCD3tD6BgUuPBX_DWJDwHOafDg@mail.gmail.com>
X-IsSubscribed: yes

On 2/21/2019 3:17 PM, Lee wrote:
> On 2/21/19, john doe wrote:
>> On 2/21/2019 5:18 PM, Lee wrote:
>>> On 2/21/19, Rockefeller, Harry  wrote:
>>>> CYGWIN_NT-6.1 HARRYR-PC 3.0.0(0.336/5/3) 2019-02-16 13:21 x86_64 Cygwin

> $ cat /tmp/x
> #!/bin/bash
> A="A"
> B="A"
> if [ $A == $B ]; then
>      echo  "identical"
> fi
> if [ $A = $B ]; then
>      echo  "identical"
> fi
> 
> $ bash /tmp/x
> identical
> identical

My reading of the bash man page says that = and == in this usage
do the same thing.  However, = is Posix compliant, while (presumably)
== is not ...   Eliot Moss

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