Skip to main content
added 99 characters in body
Source Link
Miguel
  • 274
  • 2
  • 7

you can write to the terminal's TTY; for example:

in terminal 1:

$ tty 
ttys000

in terminal 2:

$ tty
ttys029

$ exec &> >(tee >(cat >&/dev/ttys000))
ls 

Output will show in both terminals in real-time even as you type.

Works on linux and macOS. The macOS TTY path is /dev/{number} while on Linux it's /dev/pts/{number}

you can write to the terminal's TTY; for example:

in terminal 1:

$ tty 
ttys000

in terminal 2:

$ tty
ttys029

$ exec &> >(tee >(cat >&/dev/ttys000))
ls 

Output will show in both terminals in real-time even as you type.

you can write to the terminal's TTY; for example:

in terminal 1:

$ tty 
ttys000

in terminal 2:

$ tty
ttys029

$ exec &> >(tee >(cat >&/dev/ttys000))
ls 

Output will show in both terminals in real-time even as you type.

Works on linux and macOS. The macOS TTY path is /dev/{number} while on Linux it's /dev/pts/{number}

Source Link
Miguel
  • 274
  • 2
  • 7

you can write to the terminal's TTY; for example:

in terminal 1:

$ tty 
ttys000

in terminal 2:

$ tty
ttys029

$ exec &> >(tee >(cat >&/dev/ttys000))
ls 

Output will show in both terminals in real-time even as you type.