Skip to main content
Explained better
Source Link
JayCravens
  • 829
  • 4
  • 10

It seems that the overall goal is not to use the temporary file?
That's going to be nearly impossible not to involve a file.

If you want to avoid /tmp/tmp.txt you can use a FIFO.

mkfifo myfifo (echo test; print \\a > /dev/tty) > myfifo & less < myfifo rm myfifo 

You have to put it somewhere, but this might be a little more elegant than /tmp.

The echo test uses myfifo, and print \\a sends the alert character directly to /dev/tty. The & runs a subshell in the background, concurrently with less.

It seems that the overall goal is not to use the temporary file?
That's going to be nearly impossible not to involve a file.

If you want to avoid /tmp/tmp.txt you can use a FIFO.

mkfifo myfifo (echo test; print \\a > /dev/tty) > myfifo & less < myfifo rm myfifo 

You have to put it somewhere, but this might be a little more elegant than /tmp.

It seems that the overall goal is not to use the temporary file?
That's going to be nearly impossible not to involve a file.

If you want to avoid /tmp/tmp.txt you can use a FIFO.

mkfifo myfifo (echo test; print \\a > /dev/tty) > myfifo & less < myfifo rm myfifo 

You have to put it somewhere, but this might be a little more elegant than /tmp.

The echo test uses myfifo, and print \\a sends the alert character directly to /dev/tty. The & runs a subshell in the background, concurrently with less.

Source Link
JayCravens
  • 829
  • 4
  • 10

It seems that the overall goal is not to use the temporary file?
That's going to be nearly impossible not to involve a file.

If you want to avoid /tmp/tmp.txt you can use a FIFO.

mkfifo myfifo (echo test; print \\a > /dev/tty) > myfifo & less < myfifo rm myfifo 

You have to put it somewhere, but this might be a little more elegant than /tmp.