This is the mail archive of the cygwin mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: bash string-operator problem


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]