On Wed, Dec 23, 2015 at 04:05:28PM +0100, Bytec GmbH - Helmut Koeberle wrote:
> OK, with '[[' ist's working!
> 
> if ([[ "true" = "true" ]] && [[ "${h:0:1}" = "/" ]]); then echo slash; fi

You don't need parentheses around it.  The parentheses force the commands
to run in a subshell (fork()), so it just slows things down.

> if [[ "true" = "true" ]] && [[ "${h:0:1}" = "/" ]]; then echo slash; fi

This is fine, but also note that you can put && inside [[ if you wish:

  [[ "true" = "true" && "${h:0:1}" = "/" ]]

Or you can use pattern matching:

  [[ "true" = "true" && $h = /* ]]

Reply via email to