Hacker News new | past | comments | ask | show | jobs | submit login

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.



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]




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: