Manipulating shell script input, output, and errors
There are only a few things that are as pragmatic as the idea behind the concept of standard input and standard output on Linux.
Since the start of Unix, the idea of interoperability between different applications and tools installed on a system was one of the primary prerequisites that every script, tool, and application had to follow.
Simply put, if you wrote any tool on a system, you could count on three separate channels of communication to your surroundings. Based on the concept of ANSI C input/output streams called standard output and standard input, everything that runs in a shell can communicate in three ways – it can receive inputs from standard input, it can output results and information to standard output, and it can report errors to a separate output that is marked just for this task as error output.
Pair this idea with the concept that every tool should output text-only information with minimal formatting...