Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: MULTIOS input



On Jun 29, 11:34am, Wayne Davison wrote:
}
} This works for me under Linux:
} 
} setopt MULTIOS
} echo line 2 | (
} cat 9<&0 <<< 'line 1' <&9
} )

This works, too:

echo line 2 | ( cat <<< 'line 1' <<(</dev/fd/0) )

The trick is to force /dev/fd/0 to be opened before <<< changes stdin.
In fact you don't even need to fork the subshell, just use braces:

echo line 2 | { cat <<< 'line 1' <<(</dev/fd/0) }



Messages sorted by: Reverse Date, Date, Thread, Author