In a script, if you open a file descriptor like this: eval exec 3>&1
and redirect output from certain commands to it like this: echo blub >&3
then you can redirect only that certain output to a different file if needed when calling the script. By default all goes to stdout, but when called like this: ./script 3>>file1 >>file2
then you can check the separated output in file1 and the rest of stdout in file2.
Bash Tip
Entry created on 2022-11-30
Authors: steeph (336)
Categories: Bash (30)
File Descriptors (1)
Output Redirection (1)
Software (50)
Languages used: en (189)
Bash Tip
Entry created on 2022-11-30
Authors: steeph (336)
Categories: Bash (30)
File Descriptors (1)
Output Redirection (1)
Software (50)
Languages used: en (189)