Shell script cleanups #10773

Open
wants to merge 8 commits into
from

Conversation

Projects
None yet
3 participants
Contributor

practicalswift commented Jul 8, 2017 edited

Shell script cleanups:

  • Add required space to [ -n ].
  • Avoid quote within quote.
  • Exit if cd fails.
  • Remove \n which is not handled by echo.
  • Remove redundant $ in arithmetic variable expression.
  • Use $(command) instead of legacy form `command`.
  • Arrays are not supported in POSIX sh. Use bash when arrays are used.
  • [ foo -a bar ] is not well defined, use [ foo ] && [ bar ] instead.
  • [ foo -o bar ] is not well defined, use [ foo ] || [ bar ] instead.
Member

gmaxwell commented Jul 9, 2017

do we have someone on OpenBSD or likewise to test this?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment