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

Well, using Bash. A lot of these tricks aren't portable so you'll have fun when your scripts break on e.g. Dash (Ubuntu).


Also works on zsh and fish, though fish does not enumerate in the same order. Indeed does not work on sh.

Thanks for the heads up.

Too bad it's not portable, but I guess this is mainly useful in an interactive shell.

I mostly use #!/usr/bin/env sh, so my scripts will remain free of shell Cartesian products and other brace expansions.




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

Search: