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.

4
  • 2
    You can use: if [ $(echo "$ROTATION == 90" | bc) -eq 1 ] Commented Feb 6, 2015 at 16:04
  • @jofel, the good practice is to make it on this way: if [ "$(echo "$ROTATION == 90" | bc)" -eq 1 ] :) Commented Feb 6, 2015 at 16:05
  • 2
    Since this is bash: if (( $(bc <<< "$ROTATION == 90") == 1 )) Commented Feb 6, 2015 at 16:21
  • 1
    @glennjackman, thank you for the idea. I personally prefer to use old sh syntax :) But you should use -eq 1 because == in bash is to compare strings Commented Feb 6, 2015 at 16:24