Redirecting stdout to a file is common for something like listtree, which can produce thousands of lines of text. But the program interactively prompts for an encryption password -- and if the output is redirected to a file, the prompt goes there also. The program appears to hang. Or maybe it's listing folders. You can't tell.
The standard solution is to redirect the prompt to stderr, so that it remains visible even if stdout is redirected to a file.
Redirecting stdout to a file is common for something like
listtree
, which can produce thousands of lines of text. But the program interactively prompts for an encryption password -- and if the output is redirected to a file, the prompt goes there also. The program appears to hang. Or maybe it's listing folders. You can't tell.The standard solution is to redirect the prompt to stderr, so that it remains visible even if stdout is redirected to a file.