Hacker News new | ask | show | jobs
by jabirali 2129 days ago
> If you treat shell as a DSL for files and streams, nothing can beat it. Shell is amazing.

On the other hand, wouldn’t you just define anything that beats it also a shell? In my opinion, Fish beats Bash and Zsh in this area, and I would definitely call it a shell even though it’s not a POSIX-compatible shell. A more extreme example would be PowerShell (I’m not a fan but some people love it).

Where would you draw the line between a “shell” and an “interpreted scripting language that beats POSIX shells on dealing with files and streams”?

1 comments

Does fish handle <(outputting command) yet?

Powershell isn't even concurrent, its usefulness is along a different dimension to job coordination and control.

Do you mean that you want `cmd2 <(cmd1)` as a synonym for `cmd1 | cmd2`? In that case, I’m happy it doesn’t; it drastically lowers readability compared to left-to-right command pipelines, and I don’t see what value it adds.
Not quite. "<(cmd1)" creates a pipe, connects cmd1 output to it and replaces the expression the pipe name. With one argument you can often use "cmd1 | cmd2 /dev/stdin", but with two you need something better.

Think "diff <(something) <(other)" without using temporary files.

Yes, I also use this for automatically capturing command error messages with timestamps into logs: https://github.com/rust-shell-script/bash_cmd_lib/blob/0b0a6...

However this can be fragile in bash script since any sub shell command can fail. I am still wandering how to support it in this rust_cmd_lib library.

> Powershell isn't even concurrent

It's got "Start-Job" and now gets "ForEach-Object -Parallel". What else do you think it's lacking?