Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

I used zsh for gosh, over 15 years probably now. I swapped to fish at the start of this year on a bit of a whim (new year, new computer, new ~~me~~ shell).

It's pretty good in a "gets out of the way" kind of way, and the `abbr` feature is preferred over aliases but it has some annoying quirks like no dictionary type, the inability to "background blocks of code", requiring spawning a subshell + string which has other issues and in a way it feels sort of stuck between being new and friendly but still carrying over enough baggage to be annoying in other ways.

I tried Nushell a week or so ago and after getting my head around it (and $it and $in, haha) I think it feels like the future. It's not quite there ergonomically in some ways eg: reedline can't edit the current command line, but it's quite close.

What really sold me on it was when I

- Had a flat text file of "url\nartist\ntitle"

- Had to download these urls and insert the artist & title into a database

and I realised I could do it all with Nu primitives,

    open new-landings.txt
    | lines
    | each { $in | str trim}
    | chunks 3
    | each {{title: $in.0, artist: $in.1, url: $in.2}}
    | enumerate
    | par-each {
      http get ($in.item.url | str replace large medium) | save $"landing-($in.index + 101).jpg"
      # also insert artist title into database
      run-app ... etc
    }
Now, could you do the same thing with zsh/bash/sh? Yep. Some kind of awk/sed thing with xargs I would guess. But I'd have to look it up. With Nu, after a few hours of playing with it I already "knew" how to do it. That felt really powerful.

For reference, I also tried Murex and Elvish. Elvish doesn't support ctrl-z, so its disqualified right there though I like the syntax. Murex seemed fine but Nu was bigger with wider support. I think I saw Nu had pattern matching and it immediately got a big desirability bump.

I remember seeing another comment, wishing we had STDIN, STDOUT, STDERR and STDDATA, maybe one day.



Mostly a note for myself: something like this would probably work (not tested):

<new-landings.txt parallel --pipe --recend '\n\n' --colsep '\n' --plus curl '{1/large/medium}' -o '{#} + 101'.jpg

Adding multiple commands should be in a script to avoid quoting issues.


This should use --delimiter and not (--recend --pipe). Tested to work.

<new-landings.txt parallel --delimiter '\n\n' --colsep '\n' --plus curl '{1/large/medium}' -o '{#} + 101'.jpg


> I'd have to look it up.

I suspect most of the current coding assistants would have been able to do that for you in most languages, including something more portable and easier to maintain like Python.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: