Re:Top Unix Command Line Utilities
by stiff on Sunday December 30, 2012 @01:16PM
(#4986551)
I am not sure I understand what you mean. Word-splitting is performed by the "for x in y" construct, using the IFS variable, so by default if you have a file called "foo bar.mp4" the command line from the article:
will result in executing:
Which is obviously not what was meant. So it's a good habit to learn to loop over files in a directory in a different way.
[ Parent
| on HN ]
Maybe you are confusing this with what happens when you do
for i in `find -name '*.mp4'`; do # ...
or similar. In that case, the output of `find` is indeed split first, and `for` sees "foo", "bar.mp4", and so on.Ah yes, you are right, thanks!