Archive for January, 2012

Integrate Progress Indicator in Console Output

Wednesday, January 4th, 2012

I recently tried to use pv in a bash script so that it wouldn’t interfere with my concept of communicating overall progress to the user. When I usually like to do is to echo -n a description of the current task and then later echo either “Done.” or “Failed!” (or something similar). Obviously, that somewhat [...]

Check Write Permissions for Folder Hierachcy

Monday, January 2nd, 2012

While working on a bash script, I wanted to check if I could rm -rf a folder before actually attempting it and flushing the console with tons of write permission error messages. Upon failing to find what I wanted online, I constructed this beauty: find . \( -exec test -w {} \; -o \( -exec [...]