Skip to content

Fix shellcheck warnings across all bash files #7

@pataraco

Description

@pataraco

Overview

Clean up shellcheck warnings found across bash configuration files.

Total: 19 warnings across 8 files

Files to Fix

[ ] .bash_aliases (5 warnings)

  • Line 681: SC2001 - Use ${variable//search/replace} instead of sed
  • Line 681: SC2086 - Double quote $1 to prevent word splitting
  • Line 852: SC2294 - eval negates array benefits in grep alias
  • Line 1033: SC2294 - eval negates array benefits
  • Line 1189: SC2294 - eval negates array benefits in ssh function
  • Line 1509: SC2086 - Double quote $_secs

[ ] .bash_aliases_aws (6 warnings)

  • Line 2517: SC2045 - Don't iterate over ls output, use globs
  • Line 2528: SC2012 - Use find instead of ls
  • Line 2537: SC2012 - Use find instead of ls
  • Line 2549: SC2012 - Use find instead of ls
  • Line 2713: SC2154 - _c and _o referenced but not assigned in alias
  • Line 2715: SC2154 - _id referenced but not assigned in alias

[ ] .bash_aliases_ag (2 warnings)

  • Line 37: SC1091 - Not following sourced file
  • Line 49: SC2086 - Double quote $AWS_STS_EXPIRES_TS

[ ] .bash_aliases_chef (1 warning)

  • Line 677: SC2004 - $/${} is unnecessary on arithmetic variables

[ ] .bash_aliases_r5s (2 warnings)

  • Line 662: SC2004 - $/${} is unnecessary on arithmetic variables
  • Line 1087: SC2004 - $/${} is unnecessary on arithmetic variables

[ ] .bash_aliases_innovyze (1 warning)

  • Line 121: SC2128 - Expanding array without index only gives first element

[ ] .bash_profile (1 warning)

  • Line 42: SC2155 - Declare and assign separately to avoid masking return values

[ ] .git-hooks/pre-commit (1 warning)

  • Line 33: SC2295 - Expansions inside ${} need to be quoted separately

Testing

After fixes, run:
```bash
shellcheck .bash_aliases .bash_aliases_* .bash_logout .bash_profile .bashrc setup.sh .git-hooks/pre-commit
```

Should return no errors.

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions