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

  for i in *; do
    ...;
  done
works even better as it can handle files with whitespace. I usually disable file globbing but enable it specifically for code like this.

EDIT: Actually, one issue with the above is that if there aren't any matching files then you get a literal "*". But I'd rather deal with that then break when filenames have embedded whitespace.




Consider applying for YC's Spring batch! Applications are open till Feb 11.

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

Search: