Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Changed expr usage to bash arithmetic #2

Closed
wants to merge 1 commit into from
Closed

Conversation

pgl
Copy link

@pgl pgl commented Oct 24, 2013

No description provided.

@mcandre
Copy link
Owner

mcandre commented Oct 26, 2013

I was able to remove some of the expr warnings...

7946630

But I'm still getting a few expr warnings for the strings on lines 13, 15, 17, and 19.

https://github.com/mcandre/mcandre/blob/7946630dd2dcfb4c0d794f137eb5c68333a4fa2c/sh/fizzy.sh#L13-L19

Trace:

$ shellcheck fizzy.sh 

In fizzy.sh line 13:
    expr "FizzBuzz"
    ^-- expr is antiquated. Consider rewriting this using $((..)), ${} or [[ ]].


In fizzy.sh line 15:
    expr "Fizz"
    ^-- expr is antiquated. Consider rewriting this using $((..)), ${} or [[ ]].


In fizzy.sh line 17:
    expr "Buzz"
    ^-- expr is antiquated. Consider rewriting this using $((..)), ${} or [[ ]].


In fizzy.sh line 19:
    expr "$1"
    ^-- expr is antiquated. Consider rewriting this using $((..)), ${} or [[ ]].

Any idea how to resolve these? I tried $(("FizzBuzz")), but that didn't seem to work.

@mcandre
Copy link
Owner

mcandre commented Nov 20, 2013

I've incorporated your suggestions into my commits. Thanks again!

@mcandre mcandre closed this Nov 20, 2013
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants