logoalt Hacker News

oguz-ismail2last Saturday at 6:49 AM1 replyview on HN

Colorful outputs and elaborately decorated error messages are cool but maybe it shouldn't deviate that far from POSIX shells.

    $ trap '' chld
    $ nu -c test
    Error: nu::shell::io::uncategorized_error
    
      × I/O error
      ╰─▶   × failed to get exit code
    
       ╭─[source:1:1]
     1 │ test
       · ──┬─
       ·   ╰── Uncategorized error
       ╰────
    
    $

Replies

viraptorlast Saturday at 7:00 AM

There are other options if you want POSIX. But nushell just does things differently (and in a much more sane way with pipes).

Why would you want `test -e "$foo"` when you have `$foo | path exists`? Why `test -n "$foo"` when you have an actual == comparison and pattern matching expressions? And you don't have to worry about quoting things just right in any of the situations.

Yes, you need to learn a little bit of a new thing. You can even implement a test function itself if you really want to. But sometimes it's nice to just dump the legacy baggage.