I have read this Q&A, but it seems to always think the parameter as file.
I want to transform the command diff <(ls old) <(ls new) using Process Substitution from this link to one function which receive two arguments, although it is somewhat redundant.
I tried this which is just arg replace:
d2c(){
diff <($1) <($2)
}
then run d2c "objdump -d foo1" "objdump -d foo2" show d2c:1: no such file or directory: objdump -d foo1
with fifo , above problem still be there.
Q: How can I pass arg like '"objdump -d foo1"', then let it run as command?
eval:d2c () { diff <(eval "$1") <(eval "$2"); }, but if you're on zsh, you can also tryd2c () diff <(${(z)1}) <(${(z)2})Q(to remove quotes) and@within quotes to preserve empty elements in addition to thatztokenisation flag, but that would mean one could only run simple commands so would have no advantage overeval.eval "$1"works for me.$1, but that's not the default in bash, where it is in zsh.