On Thu, Apr 16, 2020 at 11:19 AM Neil Bothwick <[email protected]> wrote:
>
> On Thu, 16 Apr 2020 17:15:45 +0200, [email protected] wrote:
>
> > a loop like this
> >
> > for fn in asd* ; do
> > do_something $fn
> > done
> >
> > fails, when a file is named like this:
> >
> > List of OSses allowing spaces in filenames.txt
> >
>
> do_something "$fn"
>
That, or use ${fn} - that might be more resistant to quotes in
filenames though I haven't looked closely into that.
If you look at most ebuilds they're full of quoted or braced variables
for exactly this reason. If you want to stick spaces in your
directory paths that is your mess to deal with, but Gentoo won't
break.
On a side note, if you have a directory full of crufty filenames the
detox program is very useful for cleaning them up. Of course, that is
invasive and you probably don't want to rely on that in your script.
--
Rich