4 ms·
I guess the difference is that nesting calls (commands) is much less common in the shell, and (closely related) commands don’t really have a return value.
by layer8 4y ago
I guess the difference is that nesting calls (commands) is much less common in the shell, and (closely related) commands don’t really have a return value.
- DougBTX 4y agoOn the shell, it is all the other way around, so to use command substitution it is like this: f $(g x) To pass the output of g x to f.
- gpderetta 4y agois it? In practice I find that my shell one liners are orders of magnitude more complex than what I would dare to write in any other 'proper' language: grep "hello ($(cat patterns.txt| tr '\n' '|'|grep ')$^)" <(ssh other.host "cat ~/file.txt") |tee >(grep 'a' >As.txt) >(grep 'b' > Bs.txt) [yes, gratuitous use of cat, sue me]