linux - Unix shell descriptor redirection -



linux - Unix shell descriptor redirection -

how translate this:

echo "test" | tee -a test1 test2

to pure unix descriptor redirection solution (oneliner improve , no pipes).

is possible?

if want byte written 1 file descriptor (pipe, socket etc.) show readable info on more 1 file descriptor not dup()s of each other (but e.g. correspond 2 different regular files), it's not possible on generic unix system. if 2 file descriptors dup()s, after reading byte 1 of them create byte disappear other one, can't read twice.

if want in bash without using |, it's not possible.

if want in zsh without using |, follow chepner's comment: setopt multios, , echo test >>test1 >>test2. in background zsh create helper process copying equivalent tee -a does.

linux shell unix file-descriptor io-redirection

Comments

Popular posts from this blog

php - Android app custom user registration and login with cookie using facebook sdk -

django - Access session in user model .save() -

php - .htaccess Multiple Rewrite Rules / Prioritizing -