so im trying to get this command to work under macOS Sierra and I'm not having too much luck. basically what I want to do is have terminal echo every line, except ones containing a certain pattern of text, and finally save it to a text document. the command I am trying is:
shasum -c /Users/NAME/Desktop/foo.txt | grep -v ': OK' > /Users/NAME/Desktop/bar.txt
I don't want terminal to output & save lines that contain
: OK in them. No lines are saved to
bar.txt at all.
My output I get from running
shasum -c /Users/NAME/Desktop/foo.txt is
/Volumes/HDD-1/myfile.txt: OK /Volumes/HDD-1/badhash.psd: FAILED /Volumes/HDD-1/steak.png: OK /Volumes/HDD-1/bliss.flac: OK /Volumes/HDD-1/missingfile.rar: FAILED open or read /Volumes/HDD-1/timer.dmg: OK
EDIT: It's also probably good to note that when I run the first command, I see the correct text outputted to the terminal window, but it's never outputted to the
EDIT 2: I originally got this idea from this video at 0:54. If you look closely, you can see a similar command being run in the left side of the screen. It seems to work fine for this guy, but he's not outputting to a file.