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

sha256sum command is missing in MacOSX #84

Closed
cofinoa opened this issue Apr 23, 2016 · 5 comments
Closed

sha256sum command is missing in MacOSX #84

cofinoa opened this issue Apr 23, 2016 · 5 comments
Milestone

Comments

@cofinoa
Copy link
Contributor

cofinoa commented Apr 23, 2016

The sha256sum command used in wget script, for sha25 checksum, is missing on default MacOSX installations.

@cofinoa
Copy link
Contributor Author

cofinoa commented Apr 23, 2016

Possible solutions (just use one of these):

  1. Install GNU coreutils package provided by MacPorts. Other package managers, like Fink, would work.
  2. If no package manager is intalled then another possible solution: function sha256sum() { openssl sha256 "$@" | awk '{print $2}'; }
  3. Or use shasum perl script, creating an alias (installed by default in lateste MacOSX releases >Leopard: alias sha256sum="shasum -a 256"

The last 2 solutions should be added to user's .bashrc file.

@cofinoa
Copy link
Contributor Author

cofinoa commented Apr 23, 2016

The wget template should include a own sha256sum_ function like md5sum

@cofinoa
Copy link
Contributor Author

cofinoa commented Apr 26, 2016

Bash aliases are not exported to invoked scripts. But shell/bash functions, like variables, can be exported. Therefore create a function and then export it:
function sha256sum() { shasum -a 256 "$@" ; } && export -f sha256sum
add to your $HOME/.bashrc file

@TorstenRathmann
Copy link

Solutions 1 and 2 are added to Wget FAQ, https://www.earthsystemcog.org/projects/cog/doc/esgf/faq/wget
Solution 3 will be included in Wget scripts itself as Katharina told me.

@rjoffray
Copy link

rjoffray commented Sep 25, 2019

sudo ln -s /usr/local/bin/gsha256sum /usr/local/bin/sha256sum

solved!

thiagokokada added a commit to thiagokokada/babashka that referenced this issue May 21, 2021
sha256sum is not available in macOS by default.

See: ESGF/esg-search#84 (comment)

However, shasum seems to be avaialble, so use that instead.
thiagokokada added a commit to thiagokokada/babashka that referenced this issue May 21, 2021
sha256sum is not available in macOS by default.

See: ESGF/esg-search#84 (comment)

However, shasum seems to be avaialble, so use that instead.
borkdude pushed a commit to babashka/babashka that referenced this issue May 21, 2021
sha256sum is not available in macOS by default.

See: ESGF/esg-search#84 (comment)

However, shasum seems to be avaialble, so use that instead.
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

No branches or pull requests

4 participants