Verbosity of command output
Lastly, when running a shell script, you will see output from the commands in the script (unless you want to remove that output with redirection, which will be explained in Chapter 12, Using Pipes and Redirection in Scripts). Some commands are verbose by default. Good examples of these are the ls and echo commands: their entire function is to print something on screen.
If we circle back to the tar command, we can ask ourselves if we need to see all the files that are being archived. If the logic in our script is correct, we can assume the correct files are being archived and a list of these files will only clutter up the rest of the output from the script. By default, tar does not print anything; we have used the ...
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