[Bug 685] New: [shell] return values with spaces are not escaped correctly

bugzilla at busybox.net bugzilla at busybox.net
Tue Oct 27 17:43:16 UTC 2009


https://bugs.busybox.net/show_bug.cgi?id=685

           Summary: [shell] return values with spaces are not escaped
                    correctly
           Product: Busybox
           Version: 1.15.x
          Platform: Other
        OS/Version: Linux
            Status: NEW
          Severity: normal
          Priority: P3
         Component: Standard Compliance
        AssignedTo: unassigned at busybox.net
        ReportedBy: ab at tisco.at
                CC: busybox-cvs at busybox.net
   Estimated Hours: 0.0


The following commands do not work correctly in ash and hush:

filename "a\ b" is split into two entries in the result list.
In result lists, spaces in entries are not correctly escaped and processed
afterwards.

incorrect - e.g. #1:
# for i in `find .`
> do
> echo $i
> done
.
./ab
./a
b
#

incorrect - e.g. #2:
# for i in `ls ./a*`
> do
> echo $i
> done
./a
b
./ab

if resolved directly by the shell, results are correct.

correct - e.g. +1 (find):
# find .
.
./ab
./a b
#

correct - e.g. #1 (workaround):
# for i in ./a*
> do
> echo $i
> done
./a b
./ab
#

I checked with other special characters like "[" or "\"".

Two spaces in a filename are treated as one new line.
touch a\ \ b
# for i in `find . -name "a\ \ b"`; do echo $i; md5sum $i > $i.md5; done
./a
md5sum: can't open './a': No such file or directory
b
md5sum: can't open 'b': No such file or directory
#

Greetings from Austria,
Andy B.


-- 
Configure bugmail: https://bugs.busybox.net/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.


More information about the busybox-cvs mailing list