Skip to content

Instantly share code, notes, and snippets.

@splace
Last active October 5, 2017 20:05
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save splace/d7188b9199cf71fad6a3505dd731f40b to your computer and use it in GitHub Desktop.
Save splace/d7188b9199cf71fad6a3505dd731f40b to your computer and use it in GitHub Desktop.
shell; get item from a commands output and use as a parameter in another command.
example: test a group of files to see if together their hash is below a specified number;
cat * | sha512sum | tr " " "\n" | head -n 1 | [[ "`xargs echo $1`" < "00000001" ]]
(sha512sum always adds a file name on the same line, making this kind of stuff necessery)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment