Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: simple question on conditional expression
- X-seq: zsh-users 30375
- From: "Mathias M." <mma@xxxxxxxxxxxxx>
- To: zsh-users@xxxxxxx
- Subject: Re: simple question on conditional expression
- Date: Mon, 6 Oct 2025 16:36:02 +0200
- Archived-at: <https://zsh.org/users/30375>
- In-reply-to: <Z36OAOC3.QG24F7EC.YDGC5QCW@UOEOBWNG.T5YU5OXC.D3VB5HWZ>
- List-id: <zsh-users.zsh.org>
- Mail-followup-to: zsh-users@xxxxxxx
- References: <Z36OAOC3.QG24F7EC.YDGC5QCW@UOEOBWNG.T5YU5OXC.D3VB5HWZ>
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