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

Audit bash scripts to use "unofficial bash strict mode" in more places #565

Open
jez opened this issue May 21, 2019 · 1 comment
Open

Audit bash scripts to use "unofficial bash strict mode" in more places #565

jez opened this issue May 21, 2019 · 1 comment
Labels
good first issue Good for newcomers task A non-bug issue; work that needs to be done

Comments

@jez
Copy link
Collaborator

jez commented May 21, 2019

We have a lot of bash scripts.

We should be using set -euo pipefail in ~all of them. We are currently not doing this nearly as much as we should.

For more information on why to use set -euo pipefail, see here:

http://redsymbol.net/articles/unofficial-bash-strict-mode/

(note: i disagree with the IFS suggestions in that article; there are enough legitimate uses for " " as an IFS that warrant not making that the default. Also, shellcheck is much better at warning you for places where having " " in the IFS list might lead to surprising behavior. this is not the case for the set options).

@jez jez added the task A non-bug issue; work that needs to be done label May 21, 2019
@DarkDimius DarkDimius added the good first issue Good for newcomers label Jun 3, 2019
@azdavis-stripe
Copy link
Contributor

Should we also converge on a single shebang? I see

  • #!/bin/bash
  • #!/bin/sh
  • #!/usr/bin/env bash

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Good for newcomers task A non-bug issue; work that needs to be done
Projects
None yet
Development

No branches or pull requests

3 participants