Last active
October 5, 2017 20:05
-
-
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.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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