Hacker News new | past | comments | ask | show | jobs | submit login

Or if you need dynamic arguments, you probably want:

    N=9; for ((i=0; i<=N; ++i)); do echo "$i"; done



Why use this form of for when you can just use seq and it works in any shell including fish?


Because capturing the output of `seq` requires spawning a whole separate process (significant for small sequences) and shoving all the data into a single buffer (significant for large sequences) rather than working incrementally.




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

Search: