I have a folder with files and I have to process them in a loop. However the filenames have space characters, so the list get split.
$ touch "File Number_1"
$ touch "File Number_2"
$ ls "/tmp/File Number"_*
/tmp/File Number_1 /tmp/File Number_2
I tried following (sorry for using the `tcsh`):
$ foreach file ( `ls "/tmp/File Number"_*` )
foreach? echo ">"$file"<"
foreach? end
>/tmp/File<
>Number_1<
>/tmp/File<
>Number_2<
$ set FILES = ( `ls "/tmp/File Number"_*` )
$ while ( $#FILES )
while? echo ">"$FILES[1]"<"
while? shift FILES
while? end
>/tmp/File<
>Number_1<
>/tmp/File<
>Number_2<
set FILES = "/tmp/File Number"_*
... same as above
Can you help me to solve my problem?
btw, I don't mind to get a solution which renames the files. The files will be renamed anyway.
Best Regards
Wernfried