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.

Required fields*

3
  • Check your quoting Commented Sep 27, 2021 at 15:09
  • 2
    $( ... ) is command substitution, $(( ... )) is arithmetic expansion. (If you're running that on an interactive Bash, the error message should begin with bash: ..., implying it's from Bash and not sed.) I can't tell any reason why the parentheses would have been doubled there. The other issue is with double quotes "" vs. single quotes '', see What is the difference between the "...", '...', $'...', and $"..." quotes in the shell? Commented Sep 27, 2021 at 15:18
  • Copy/paste that and any other shell scripts you write into shellcheck.net and fix the issues that tool can tell you about. Commented Sep 28, 2021 at 22:20