Using less in environment without controlling tty
Cathey, Jim
jcathey at ciena.com
Tue Jul 30 17:12:01 UTC 2013
My understanding (sans looking at any particular code) is that
more/less/et al. read from stdin, write to stdout, and, if necessary,
read _commands_ from /dev/tty. This allows them to work in a
pipeline as well as interactively. The /dev/tty access is supposed to
be a last-ditch effort to find a channel to get interactive input from,
like password setting and the like. So why not use isatty(stdout)
to determine whether or not to open /dev/tty? That lets things
like:
... | less | tee outfile
work.
-- Jim
More information about the busybox
mailing list