Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

5
  • 2
    Where you remove the parentheses, this is exactly @miku's original answer at the top.
    – dolmen
    Commented Mar 4, 2016 at 13:56
  • 1
    Without parentheses the expression doesn't evaluate.
    – will
    Commented Mar 6, 2016 at 11:01
  • @will yes it does. You dont need the ()s.
    – phil294
    Commented Nov 3, 2017 at 17:00
  • 1
    @Blauhirn ... Hi, I based my comments on experiments with GNU Bash on a Linux Mint /Ubuntu PC. You are probably right in theory ()-s are not needed. My only response, is try it out, it seems to depend on Bash version, the actual expression or context and such.
    – will
    Commented Nov 6, 2017 at 7:13
  • This is obviously (to me) the most clear syntax, but there's gotta be a catch somewhere. I don't think it works with integer values: > bucket_available=0; > if ($bucket_available); then echo hi; fi bash: 0: command not found Commented May 19, 2023 at 16:11