Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

8
  • Sounds a bit like Tripwire? Commented Aug 9, 2022 at 11:57
  • s1=$(sha256sum "$x" > "$x.sha256") should be sha256sum "$x" > "$x.sha256" Commented Aug 9, 2022 at 11:59
  • Hello @roaima, I made the above change. But, this didn't help. I still have same behavior. Commented Aug 9, 2022 at 12:26
  • TBH I'm not entirely clear what you think the problem is Commented Aug 9, 2022 at 12:41
  • You're running sha256sum on "$x" regardless of if the check fails so it looks like it should update the .sha256 file after giving the warning. The command substitution in s1=$(sha256sum "$x" > "$x.sha256") is a bit useless, though, as you're redirecting the output of sha256sum to a file, there's no output for the shell to catch. It shouldn't affect what the program does, however. Also, it doesn't look like you're using s1. If you are, and want to get the output of sha256sum to a file and to a shell variable, then use something like s1=$(sha256sum "$x" | tee "$x.sha256") Commented Aug 9, 2022 at 12:48