Write to file descriptor 3 without writing to disk? Write to file descriptor 3 without writing to disk? shell shell

Write to file descriptor 3 without writing to disk?


Depends on what you want to do. Suppose you want to write strings at your leisure and print them reversed. set up a file descriptor redirecting into a process substitution waiting for stdin:

$ exec 3> >(rev)$ echo hello world >&3dlrow olleh

When you're done with it, you can close the file descriptor

$ exec 3>&-$ echo hello world >&3bash: 3: Bad file descriptor