On Sunday 07 October 2007, Roy Marples wrote: > On Sun, 2007-10-07 at 01:06 -0400, Mike Frysinger wrote: > > > You can also do some pattern matching like so > > > > > > foo="foo foobar" > > > > > > [ "${foo%foobar}" = "${foo}" ] || echo "ends with foobar" > > > [ "${foo#foobar}" = "${foo}" ] || echo "starts with foo" > > > [ "${foo#* }" = "${foo}" ] || echo "has a space" > > > > > > So there's no need for convoluted nested case statements. > > > > "no need" implies that everything can be done, but you started off > > with "some" ... > > Yes, the some being =~, which is the only operator I know of that cannot > be done with posix sh > > > you're still going from one clean logic statement to multiple > > ones where the nested logic gets to be a pita to track. again, this > > is a sad/unacceptable solution. > > OK, it's time to pony up - show me a code snippet which you think a > nested code snipet which you think is unworkable in posix sh when > transitioning from [[ ]] to [ ].
i never mentioned =~. i already gave perfectly acceptable examples of using == with pattern matching and your unacceptable workaround was to use [possibly nested] case statements. -mike
signature.asc
Description: This is a digitally signed message part.