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

>Remember to test your patterns with a print statement first

ZSH has an option to expand globs onto the command line the first time you hit return, and issue the command the second. I don't remember what it is.




By default zsh will expand globs if you hit tab on the command line.

However if you have more than a handful of matches it's going to be a suboptimal method of eyeballing the glob results.

I prefer to use `print -l` as it will break the glob results on separate lines.

An additional benefit of ZSH is that it will normally return each glob result as an independent item (this avoids the problem bash has with just returning strings that in turn are broken on IFS characters). Using that flag with print will give you a clear sense of the actual results.




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

Search: