Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: simple question on conditional expression



On Mon, Oct 06, 2025 at 12:24:19PM +0200, Helmut Jarausch wrote:
> if ( echo $ANS | grep B ); then echo OK;fi

Why the '()'?

```zsh
ANS=ABC
if echo $ANS | grep -q B; then echo OK; fi
```
result:
OK

Works like a charm without the '()' ¯\_(ツ)_/¯ 

Regards,
Mathias
-- 
UBNC (user brain not connected)

Attachment: signature.asc
Description: PGP signature



Messages sorted by: Reverse Date, Date, Thread, Author