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

A small tip for the for loops:

  for n in {9..0}; do echo $n ; done
or

  for n in $(seq 9 -1 0); do echo $n ; done



Cool - thanks. I did actually know that, but I never got around to changing it to the more efficient version, and it's nice to be reminded.




Consider applying for YC's Fall 2025 batch! Applications are open till Aug 4

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

Search: