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

OS400: fix shellcheck warnings in scripts #13309

wants to merge 6 commits into from


Copy link

@vszakats vszakats commented Apr 7, 2024

  • use $() instead of backticks, and re-arrange double-quotes inside.
  • add missing || exit 1 to cd calls. (could be dropped by using set -eu.)
  • add -n to a few ifs.
  • shorten redirections by using {} > (as shellcheck recommended).
  • silence warnings where variables were detected as unused (SC2034).
  • a couple misc updates to silence warnings.
  • switch to bash shebang for -ot feature.
  • split two lines to unbreak syntax highlighting in my editor. ($(expr \, $(dirname \)

Also enable CI checks for OS/400 shell scripts.

Ref: #13307
Closes #13309

Added one FIXME in where there is a single use of a non-POSIX
expression [ "${1}" -ot "${2}" ] causing a warning. We can fix this by bumping
the shebangs to bash, or come up with a POSIX alternative.

/cc @monnerat

@vszakats vszakats added the build label Apr 7, 2024
@github-actions github-actions bot added the script label Apr 7, 2024
@vszakats vszakats changed the title os400: fix shellcheck warnings in scripts OS400: fix shellcheck warnings in scripts Apr 7, 2024
@github-actions github-actions bot added the CI Continuous Integration label Apr 8, 2024

This comment was marked as resolved.

@vszakats vszakats closed this in 8a622ba Apr 11, 2024
@vszakats vszakats deleted the ci-shellcheck-os400-2 branch April 11, 2024 07:49
vszakats added a commit to vszakats/curl that referenced this pull request Apr 13, 2024
Build scripts must be executed by the os/400 shell (sh), not bash which
is a PASE program: The `-ot` non-POSIX test extension works in os/400 as
well. Ref: libssh2/libssh2#1364 (comment)

Follow-up to 8a622ba curl#13309
Assisted-by: Patrick Monnerat
Closes #xxxxx
@vszakats vszakats mentioned this pull request Apr 13, 2024
vszakats added a commit that referenced this pull request Apr 15, 2024
Drop/fixup mods trying to make some syntax highlighters happier.

Follow-up to 8a622ba #13309
Closes #13362
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
build CI Continuous Integration script

Successfully merging this pull request may close these issues.

None yet

2 participants