News for hackers. Stuff that matters.
Re:Fish shell by chubot on Monday May 17, 2021 @12:33PM (#27185316)
Even something like

   # only test if the build succeeds
   ./build.py && ./test.py 
didn't work in fish until recently. It used to be 'and' but they recently added && for compatibility.

I think redirects and possibly pipelines work differently in fish too, although I don't remember the details. I type those on the command line frequently. I occasionally use loops as well, though when it gets big I do put it in a file.

Re:Fish shell by chubot on Monday May 17, 2021 @02:53PM (#27186824)
It looks like all of these are the same

    echo hi > out.txt
    echo append >>  out.txt
    sort < stdin.txt
    ls /bad 2>&1 | tee out.txt
   
But here docs don't work the same way:

   sort <<EOF  # syntax error in fish
I don't really like the here doc syntax so I guess that is pretty good. The && issue is still there on my Ubuntu Bionic machine:

    fish: Unsupported use of '&&'. In fish, please use 'COMMAND; and COMMAND'.
ls && ls
Re:Fish shell by ridiculous_fish on Monday May 17, 2021 @03:34PM (#27187394)
The && syntax was added in fish 3, released in 2018.
Re:Fish shell by mattgreenrocks on Monday May 17, 2021 @01:20PM (#27185820)
Redirects and pipes work as you'd expect. Loop syntax is different. The difference in subshell invocation is the thing that sticks out the most: $(cmd) vs (cmd) in fish.
Re:Fish shell by iamevn on Tuesday May 18, 2021 @06:05AM (#27192887)
Piping and redirects seem to just work, command substitution is always just parentheses with no $ in front. Process substitution is not magic syntax like in sh, it's just a command that reads from stdin, writes to a temporary file, and outputs the path to that file:

vim (ls -lh | psub)