1

I made a shell script which uses this command to calculate a sha256 checksum recursive for a directory for example /run/media/$USER/directory:

find . -type f -exec sha256sum {} \; | sort -k 2 | sha256sum

This process takes some time. Meanwhile I want to display a progress bar via zenity that shows the current progress according to the command. I tried it with:

find . -type f -exec sha256sum {} \; | sort -k 2 | sha256sum | zenity --progress --title="Checksum"

but it doesn't show any percentages:

enter image description here

Thanks for your time! :)

1
  • Please tell us more about your dataset. Eg: find . -type f | parallel -X du | perl -ane '$F[0]=~s/\S/9/g; print $F[0],"\n"'| sort -n | uniq -c Commented Oct 6, 2022 at 18:11

1 Answer 1

0

find . -type f |
  parallel --bar sha256sum {} 2> >(perl -pe 'BEGIN{$/="\r";$|=1};s/\r/\n/g' |
    zenity --progress --auto-kill) |
  sort -k 2 | sha256sum
2
  • Unfortunately, it doesn´t seem to work :/ . The progress bar is always at 100%. Commented Oct 6, 2022 at 9:15
  • @stewie I think you need to tell us more about your dataset. Commented Oct 6, 2022 at 18:04

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.