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

Using ls instead of a glob can be valid if you need to force ordering for some reason (you want to process things in date order for instance, IIRC the order out of a glob wildcard is alphanumeric in most places and arbitrary in some). Your point about spaces in filenames is definitely valid though but my preferred solution to that would be to stab people with a needle every time they put a space in a filename!



Bah, spaces are perfectly cromulent characters. It's the bourne shell that's broken. rc works fine with them.


There are a great many things on the command line (less elsewhere, but still some) that don't handle spaces in filenames well.

You are probably right that this is a technological fault rather than a problem with spaces themselves, but IMnsHO until we are not regularly using spaces as list item separators using them with the items being listed is asking for issues.


You can easily deal with spaces in bourne shell. Quote your variables. Change the IFS to make it only newlines. Of course, newlines in filenames are perfectly valid too.


Spaces are perfectly okay in a filename. Not that I use them, but this isn't 1990 anymore.




Join us for AI Startup School this June 16-17 in San Francisco!

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

Search: