[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
for command doesn't handle spaces in filename well!
From: |
Alex |
Subject: |
for command doesn't handle spaces in filename well! |
Date: |
Tue, 26 Nov 2002 14:36:40 -0600 (CST) |
Configuration Information [Automatically generated, do not change]:
Machine: i686
OS: linux-gnu
Compiler: gcc
Compilation CFLAGS: -DPROGRAM='bash' -DCONF_HOSTTYPE='i686'
-DCONF_OSTYPE='linux-gnu' -DCONF_MACHTYPE='i686-pc-linux-gnu'
-DCONF_VENDOR='pc'
-DSHELL -DHAVE_CONFIG_H -D_GNU_SOURCE -I. -I. -I./include -I./lib -O2
-march=i386
-mcpu=i686
uname output: Linux Bhodoo.HomeLinux.Net 2.4.18-18.7.x #1 Wed Nov 13
19:05:27 EST
2002 i686 unknown
Machine Type: i686-pc-linux-gnu
Bash Version: 2.05a
Patch Level: 0
Release Status: release
Description:
I was using the 'for' command under bash in a script. It was
operating on an entire
directory of files, like
for f in *; do .......; done
I discovered that on filenames with two consequtive spaces in
them, that the for
command somehow 'removes' all but one space.
Repeat-By:
Try the following code:
echo HELLO>"HELLO THERE"
echo HI >"HI THERE"
for f in H*; do echo $f;done
Resulting Output:
HELLO THERE
HI THERE
- for command doesn't handle spaces in filename well!,
Alex <=