Tom Eastep wrote: > On 5/8/13 5:33 PM, "Dash Four" <[email protected]> wrote: > >> Tom Eastep wrote: >> >>> On 5/7/13 4:30 PM, "Dash Four" <[email protected]> wrote: >>> >>>> Tom Eastep wrote: >>>> >>>>> Patch attached. >>>> Applied and tested with changes (see patch attached), >>>> >>> You are aware that '==' is only supported by bash and that much of the >>> world outside of Redhat doesn't use bash as /bin/sh? I'm guessing not. >>> >> I am guessing you haven't got a clue, have you? >> > > I have the following clue: > > root@gateway:~# /bin/sh > # [ a == a ] && echo Yes > [: 1: a: unexpected operator > # exit > > root@gateway:~# [ a == a ] && echo Yes > Yes > root@gateway:~# > > > On this system (Debian), /bin/sh is the Dash shell. > > So '==' doesn't appear in any of my shell code that is destined to run on > all distributions. > Have a very good read at your own post from yesterday (if you can, that is). Please pay particular attention to the "'==' is only supported by bash" bit. Now, my turn to show off:
~# /system/xbin/ash /opt # ash --help BusyBox v1.19.3-cm7 bionic (2011-11-14 16:52 +0100) multi-call binary. Usage: ash [-/+OPTIONS] [-/+o OPT]... [-c 'SCRIPT' [ARG0 [ARGS]] / FILE [ARGS]] Unix shell interpreter /opt # [ 0 == 1 ] || echo Yes Yes /opt # That was BusyBox using ash. As you may or may not be aware, BusyBox is widely used in routers/embedded or resource-constrained devices and has nothing whatsoever to do with Redhat and 'ash' ain't exactly 'bash'. Then, there is the korn shell (ksh) and derivatives (zsh etc) - even though I can't demonstrate the above example (I use ksh on a few of my embedded devices where there is no terminal - tty - capabilities present), I can enclose the relevant parts from the ksh man page for your benefit: string == pattern True, if string matches pattern. Any part of pattern can be quoted to cause it to be matched as a string. With a successful match to a pattern, the .sh.match array variable will contain the match and sub-pattern matches. Next in line is the c shell (csh) and his big brother tcsh (which is what I used before bash) - again, extracted from the man page for your own benefit: Logical, arithmetical and comparison operators :- These operators are similar to those of C and have the same precedence. They include || && | ^ & == != =~ !~ <= >= < > << >> + - * / % ! ~ ( ) Would you like me to go on? Thought not! As I already put it to you yesterday - you are a bit clueless, aren't you? ------------------------------------------------------------------------------ Learn Graph Databases - Download FREE O'Reilly Book "Graph Databases" is the definitive new guide to graph databases and their applications. This 200-page book is written by three acclaimed leaders in the field. The early access version is available now. Download your free book today! http://p.sf.net/sfu/neotech_d2d_may _______________________________________________ Shorewall-devel mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/shorewall-devel
