From 2878959c177b1eb1edabb214b5a40da3ef8528f6 Mon Sep 17 00:00:00 2001 From: EuAndreh Date: Wed, 25 Jul 2018 11:41:08 -0300 Subject: Remove inline comments: doesn't work with pipe --- bash/util.sh | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/bash/util.sh b/bash/util.sh index cdf4fd5..4fc11ab 100644 --- a/bash/util.sh +++ b/bash/util.sh @@ -24,9 +24,9 @@ extract () { merkle-tree () { dirname="${1-.}" - find "$dirname" -type f | \ # get all files in the $dirname tree - sort | \ # sort them to get the same result on different filesystems - xargs sha256sum | \ # compute the SHA256 of each file, BONUS it outputs the filename, so if the content does not change but the filename does, the end hash will be different - sha256sum | \ # compute the final hash - awk '{print $1}' # omit the filename, which is `-` as stdin in this case + find "$dirname" -type f | \ + sort | \ + xargs -I{} sha256sum "{}" | \ + sha256sum | \ + awk '{print $1}' } -- cgit v1.2.3