Re:Ante: A low-level functional language
by layer8 on Friday June 17, 2022 @07:45AM
(#31776754)
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.
[ Parent
| on HN ]
On 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.is 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]