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

Fix SC2004 #49

Open
noraworld opened this issue Apr 19, 2023 · 0 comments
Open

Fix SC2004 #49

noraworld opened this issue Apr 19, 2023 · 0 comments

Comments

@noraworld
Copy link

When I use getoptions, I always have to manually ignore SC2004 that ShellCheck points out.

In foo line 62:
          REST="${REST} \"\${$(($OPTIND-$#))}\""
                                ^-----^ SC2004 (style): $/${} is unnecessary on arithmetic variables.


In foo line 68:
        REST="${REST} \"\${$(($OPTIND-$#))}\""
                              ^-----^ SC2004 (style): $/${} is unnecessary on arithmetic variables.

For more information:
  https://www.shellcheck.net/wiki/SC2004 -- $/${} is unnecessary on arithmeti...
    59	      --)
    60	        shift
    61	        while [ $# -gt 0 ]; do
*   62	          REST="${REST} \"\${$(($OPTIND-$#))}\""
    63	          shift
    64	        done
    65	        break ;;
    66	      [-]?*) set "unknown" "$1"; break ;;
    67	      *)
*   68	        REST="${REST} \"\${$(($OPTIND-$#))}\""
    69	    esac
    70	    shift
    71	  done

Is it possible to fix this?

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

No branches or pull requests

1 participant