Hacker News new | ask | show | jobs
by samatman 2093 days ago
won't this echo "*" if there are no files in the directory?

I always have to look up the 'safe iteration' invocation when iterating files in a directory, because it involves jumping through a few more hoops than is really reasonable.

1 comments

Yes. You can change the behaviour in bash by setting the nullglob option (shopt -s nullglob).