Consider this scenario:
diff file.txt <( cat file.txt | grep -v '^\s*#'| sed '/^$/d' )
this is an example of redirect from right to left, in which you process a file and redirect the result as input to diff
. Similar use case has been proposed here, which also works fine.
However, attempt to redirect result of file processing to a code block in a similar fashion fails:
while read I; do
…
done <( cat $FIL | <do_something_here> )
Syntax error: "(" unexpected
Or, if you try this:
done < <( cat $FIL | <do_something_here> )
Syntax error: redirection unexpected
How do you redirect output of some process to code block as input?
while ... done < <(...)
works fine enough (here's an old example from this site: https://unix.stackexchange.com/a/9789/70524). Please show the whole code which givesSyntax error: redirection unexpected
– muru Oct 24 '21 at 16:23