There has been rarely a day where I have not learned something new after joining this new job. And I have been extremely lazy in noting it down. However, better late than never. Here is a thing which I learned yesterday:
$ #!/bin/sh -e
Adding this line above the shell script will exit the script as soon as it encounters a failure in executing any command. Learned it hard way, after spending / debugging around 15-20 mins :-(
And a most wishful feature of “dd” command – with progress bar or some sort of feedback on how much data is copied: Use “dcfldd” instead of “dd” which by default shows how much data is copied.
Happy learning and sharing!