News for hackers. Stuff that matters.
Re:The fish shell is amazing by dietr1ch on Thursday November 25, 2021 @12:05PM (#29342967)
I moved from bash => zsh => fish. I wanted reasonable features on my shell, and fish was much faster and needed almost no plugins.

The fact that I can write a simple for loop without needing to look up how to do it by far beats the POSIX compatibility, if I need it I can still write a bash script, but when using the shell I don't need to recall where semicolons or `do`, brackets (and how many) go.

Re:The fish shell is amazing by macromagnon on Thursday November 25, 2021 @04:22PM (#29345112)
Is it that hard to remember a bash for loop?

  for i in $(seq 1 10)
  do echo $i
  done
Then you can just replace new lines with ; if writing a one liner.

  for i in $(seq 1 10); do echo $i; done
I guess it isn't as simple as python

  for i in range(10): print(i)
but it's pretty close aside from the variable binding.
Re:The fish shell is amazing by shakna on Thursday November 25, 2021 @07:49PM (#29346537)
Bash has some subtleties around loops that can be frustrating, like the body of your loop _may_ actually be running in a subshell (common when iterating over a file), making it difficult to extract what you want from it.
Re:The fish shell is amazing by bandie91 on Friday November 26, 2021 @08:04AM (#29349900)
i bet it's the `cat file | while read …` loop what you are referring to, not any loop. but correct me.
Re:The fish shell is amazing by alerighi on Thursday November 25, 2021 @07:12PM (#29346298)
In zsh you can avoid the do if you have a single instruction:

    for i in {1..10}; echo $i
to me is as clear as the python version. Very compact and useful for one liners.
Re:The fish shell is amazing by ulam2 on Thursday November 25, 2021 @11:14PM (#29347437)
As someone dealing with new remote machines on a daily basis, I cannot fantasize about any other shell. Bash is pretty straightforward.
Re:The fish shell is amazing by yesenadam on Thursday November 25, 2021 @04:37PM (#29345226)

  for i in {1..10}
Re:The fish shell is amazing by tekknik on Friday November 26, 2021 @11:58AM (#29351889)
And look at all of those finger bending symbols!
Re:The fish shell is amazing by thibran on Thursday November 25, 2021 @05:32PM (#29345599)
> I moved from bash => zsh => fish

Did the same, but moved on.

Now it is: bash => zsh => fish => nu

Re:The fish shell is amazing by stevage on Thursday November 25, 2021 @06:17PM (#29345934)
What did you prefer about nu?
Re:The fish shell is amazing by thibran on Friday November 26, 2021 @02:01AM (#29348054)
Working with tables of data feels more right, more like programming then the usual shell. I also work quite often with CSV and it's nice to be able to manipulate/filter it like any other data that nu is able to read (just: open file.csv | find "foobar" | select name message).
Re:The fish shell is amazing by tekknik on Friday November 26, 2021 @12:00PM (#29351905)
Not quite a straightforward as nu seams to be, but I used to have ipython as my shell when I did a lot of work with CSV. It’s “not a shell” but includes some shell like functions to make listing dirs and such easier.