Skip to main content
9 events
when toggle format what by license comment
Aug 26, 2013 at 21:05 comment added slm @StephaneChazelas - I don't doubt you're right, but I've never grasped the subtlety of the ins/outs of what's going on here. If I swap in an ls -F to my example it still works. I don't understand your comment about the globbing being performed upon command substitution. I suspect others also miss these details and hence why seem to see this family of questions so frequently here. A canonical answer is definitely needed on this topic (you've pretty much started one with your A to this Q).
Aug 26, 2013 at 19:53 comment added Stéphane Chazelas You're missing the fact that globbing is performed upon command substitution since it was not disabled and that ls was aliased to ls -F.
Aug 26, 2013 at 17:43 history edited slm CC BY-SA 3.0
added 483 characters in body
Aug 26, 2013 at 17:15 comment added mike @slm ...edited this comment. It's not empty, it's a \n.
Aug 26, 2013 at 17:13 comment added slm @mike - what does $IFS look like? echo $IFS.
Aug 26, 2013 at 16:59 comment added slm @val0x00ff - on technical merits I 100% agree with you, but when doing one off scripts, I've done this exact thing and never had any issues. As long as you understand the implications as the operator it doesn't matter. Just my $0.02. If a script will only ever see the light of day on a single system, the different implementations of ls doesn't matter either.
Aug 26, 2013 at 16:57 comment added Valentin Bajrami @slm, I have to disagree on ls use in the for loop context.ls is purely designed for the human eye. Different operating systems parse ls output differently.
Aug 26, 2013 at 16:39 comment added mike I added debug data to the question. The single quotes did not change anything. The spaces are in the path name, but I'm doing a local operation here. The file names are spaces-free, I don't think that is the problem.
Aug 26, 2013 at 16:26 history answered slm CC BY-SA 3.0