I'm clearly not expecting the right results.
$ man less
In another terminal:
$ ps u
# Find that pid of less is 45783
$ lsof -p 45783
COMMAND PID USER FD TYPE DEVICE SIZE/OFF NODE NAME
less 45783 lust cwd DIR 1,4 442 46 /usr/share/man
less 45783 lust txt REG 1,4 137712 9698 /usr/bin/less
less 45783 lust txt REG 1,4 600576 9397 /usr/lib/dyld
less 45783 lust txt REG 1,4 303120384 2911813 /private/var/db/dyld/dyld_shared_cache_x86_64
less 45783 lust 0 PIPE 0xffffff8025bf38c0 16384
less 45783 lust 1u CHR 16,2 0t82970 763 /dev/ttys002
less 45783 lust 2u CHR 16,2 0t82970 763 /dev/ttys002
less 45783 lust 3r REG 1,4 4589 286688 /private/etc/man.conf
less 45783 lust 4r CHR 2,0 0t0 306 /dev/tty
$ echo "q" > /dev/ttys002
At this point the terminal that man less
is running in prints q and a newline, rather than quitting the display of the manpage.
How can I make it send the raw "q"? Piping does not work, I get "zsh: permission denied: /dev/ttys002". Switching echo
for cat
and typing it in did not work either.