logoalt Hacker News

HackerThemAllyesterday at 11:06 PM6 repliesview on HN

> bash's syntax is so weird

What should be the syntax according to contemporary IT people? JSON? YAML? Or just LLM prompt?


Replies

bigstrat2003today at 1:01 AM

Nushell, Powershell, Python, Ruby, heck even Perl is better. Shell scripting is literally the worst language I've ever seen in common use. Any realistic alternative is going to be better.

show 1 reply
ifh-hnyesterday at 11:54 PM

Nushell! Or powershell, but I much prefer nushell!

sigwinchtoday at 12:37 AM

There's a movement to write JSON to fd 3, as a machine-parsable alternative to rickety fd 1.

show 1 reply
nazgul17today at 12:16 AM

Trying to be language agnostic: it should be as self-explanatory as possible. 2>&1 is all but.

Why is there a 2 on the left, when the numbers are usually on the right. What's the relationship between 2 and 1? Is the 2 for std err? Is that `&` to mean "reference"? The fact you only grok it if you know POSIX sys calls means it's far from self explanatory. And given the proportion of people that know POSIX sys calls among those that use Bash, I think it's a bit of an elitist syntax.

show 1 reply
xeonmctoday at 12:00 AM

Haskell

ameliusyesterday at 11:13 PM

Honestly, Python with the "sh" module is a lot more sane.

show 1 reply