by bxparks · 6y ago · 0 comments
echo "message" 1>&2
Yes, that's probably a good idea, though I cannot recall this causing a problem for any script that I've written so far. fancycommand --help | less
works as expected. Otherwise, the help text will dump to the screen and less will erase it when it decides to redraw its empty buffer! Actual error messages should go to stderr so that I can redirect them to an error log or so I can suppress them if need be, or I could also be doing > /dev/stdout to silence normal output but I don't want errors to be discarded. $ tens.sh --verbose 5
10
100
1000
10000
100000
Calculated 5 results
$ tens.sh --verbose 5 > results
Calculated 5 results