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

Update sample scripts in plugin docs for best practices conformance #297

Merged
merged 1 commit into from
Feb 11, 2013

Conversation

charles-dyfis-net
Copy link
Contributor

  • Use printf %q to quote arguments to survive expansion by the remote
    shell (started by ssh) unharmed.
  • Quote all local parameter expansions to prevent contents from being
    word-split and glob-expanded.
  • Replace use of external tool basename with a parameter expansion
    (shell builtin; no fork/wait overhead)
  • Do not use exec on a command for which additional commands are
    expected to be run in the same shell. (exec replaces the current
    process, and does not return).
  • Move assignments from $1 and shifts onto the same line for easier
    reading.
  • exit $? is redundant; the default behavior of exit is to honor
    $?.

- Use `printf %q` to quote arguments to survive expansion by the remote
  shell (started by ssh) unharmed.
- Quote all local parameter expansions to prevent contents from being
  word-split and glob-expanded.
- Replace use of external tool `basename` with a parameter expansion
  (shell builtin; no fork/wait overhead)
- Do not use `exec` on a command for which additional commands are
  expected to be run in the same shell. (`exec` replaces the current
  process, and does not return).
- Move assignments from `$1` and `shift`s onto the same line for easier
  reading.
- `exit $?` is redundant; the default behavior of `exit` is to honor
  `$?`.
ahonor added a commit that referenced this pull request Feb 11, 2013
Update sample scripts in plugin docs for best practices conformance
@ahonor ahonor merged commit 7288b4b into rundeck:development Feb 11, 2013
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

Successfully merging this pull request may close these issues.

2 participants