Hi,
White spaces are a complete nightmare for shell scripting, as
when you pass them around it is very difficult to ensure that they
are always handled with the correct quotes, and sometimes the
commands you run don't allow you to embed enough different
levels of quotes.
Hence our strong recommendation is to never have spaces in
your filenames.
All the best,
Mark
On 29 May 2009, at 16:39, Lazar Fleysher wrote:
> Hello everybody,
>
> Most likely, it is a known problem, but I did not find anything in the
> mailing list archives,
> so I thought I would post it.
> Another possibility is that I do not understand something which is
> almost always correct.
>
> It seems that some (very convenient) scripts supplied by FSL (I am
> talking about
> remove_ext, imtest, imglob, etc) do not handle file names with white
> spaces
> very well.
>
> I have looked only at imglob, and I think there is an easy fix:
>
> somewhere around line 91 in the current script, I see this
>
> # process each argument, removing any possible extension and
> # then expanding for valid extensions
>
> lst="";
> for aa in $@ ; do
> # repeat remove_ext a few times to expand out all wildmasking
> a=`${FSLDIR}/bin/remove_ext ${aa}`;
> # at this point variable 'a' may have been expanded into a list
>
>
> The line: for aa in $@ ; do
> should probably read: for aa in "$@" ; do
>
> This, I think, would fix the problem. Can anyone confirm this
> or there is another work around?
>
> Thanks a lot
>
> Lazar
>
|