A note on verbosity
It is important to realize that, just as it is on the command-line directly, only output (stdout/stderr) is logged. By default, most commands that run successfully do not have any output; examples of these are cp, rm, touch, and so on. If you want informative logging in your scripts, it is your responsibility to add output where you see fit. The easiest way to accomplish this is by simply using an echo here and there. The easiest way to make a log file give confidence to the user is by having the final command in your scripts be echo "Everything went well, exiting script.". As long as you handle all potential errors properly during your script, you can safely say that once it reaches the final command the execution has ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access