News for hackers. Stuff that matters.
Re:Show HN: A smarter Unix shell and scripting environment by latexr on Tuesday June 13, 2023 @11:10AM (#36311384)
Note how the line ends with a backslash. That is escaping the newline so the command isn’t executing immediately. The next line begins with a pipe which is taking the input. It’s a way of separating multiple piped commands over several lines for readability. In other words, these are equivalent:

  echo 'Something or other' | sed 's/or/and/'
and

  echo 'Something or other' \
    | sed 's/or/and/'
Re:Show HN: A smarter Unix shell and scripting environment by alexgrover on Tuesday June 13, 2023 @11:43AM (#36311920)
I think the point they’re trying to make is that the “open” command does something very different than the Mac builtin
Re:Show HN: A smarter Unix shell and scripting environment by vram22 on Tuesday June 13, 2023 @12:08PM (#36312293)
IIRC, in this case, backslashes are not needed.

You can just end each partial line of such long commands with a pipe sign and keep writing the rest of the overall command on subsequent lines, except for the last partial line, where you just press Enter to complete and run it.