I have long command roughly this:
$ command-outer "long command which references a file here: filename1, and another file reference here: filename2"
The files are the output of another command. So I am doing:
$ command-outer "long ... "<(command-inner "again long params")"... "\
<(command-inner "again long params")" ..."
For readability I'd like to extract the inner unnamed/anonymous pipes (the ones with <()
) from the long command invocation. However I can't seem to do so; doing the following:
RESULT_FILE_DESCRIPTOR1=<(command-inner ....)
leads to the file descriptor already being closed when I actually use RESULT_FILE_DESCRIPTOR1
in the params list of command-outer
And invocating command-outer
on the same line, thus:
RESULT_FILE_DESCRIPTOR1=<(command-inner ....) outer-command "long ... $RESULT_FILE_DESCRIPTOR1 ... "
gives back an empty result RESULT_FILE_DESCRIPTOR1, which is not a big surprise since a:
FOO=BAR echo $FOO
Also doesn't work.
<(…)
construct is called "process substitution". Please update your question (title and body) to use the correct terminology. – Jonathan Leffler Sep 28 '15 at 13:44/dev/fd/[num]
links. themkfifo
command can get you a named pipe, but most unix/dev/
filesystems will provide links to pipe descriptors as well. doecho <(:)
and see for yourself. – mikeserv Sep 28 '15 at 23:11