Skip to content

Resolve ignored Shellcheck issues #181

@IGPenguin

Description

@IGPenguin

🐞 Whats wrong

The following warnings are currently ignored in new pull requests:

  • SC2001 - replace sed with ${variable//search/replace}
  • SC1090 - non-constant source
  • SC2207 - no arrays like this ($())
Using xargs -I
Given the -I option, xargs will perform an action for each line of text that we feed into it. We can give the line a variable name to use in commands that xargs can execute.
$ adb devices | tail -n +2 | cut -sf -1 | xargs -I X echo X aw yiss
ZY2222NP55 aw yiss
192.168.56.101:5555 aw yiss
We can see here that we have told xargs to take each line of text (each identifier), and refer to it as X. Then execute the echo command with the identifier and the string “ aw yiss”. And xargs happily obliges.

🌈 Desired state

All Shellcheck issues are resolved and none are ignored.

📏 Challenges

I dont have deep shell skills 😅

📂 Sources

google.com

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementexisting functionality extensionhelp wantedunknown solution or major effort inevitable

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions