bug-bash
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

ARRAYS, SPACES and '"'


From: posern
Subject: ARRAYS, SPACES and '"'
Date: Mon, 27 Aug 2001 22:47:56 +0200 (CEST)

Configuration Information [Automatically generated, do not change]:
Machine: i386
OS: linux-gnu
Compiler: gcc
Compilation CFLAGS:  -DPROGRAM='bash' -DCONF_HOSTTYPE='i386' 
-DCONF_OSTYPE='linux-gnu' -DCONF_MACHTYPE='i386-pc-linux-gnu' 
-DCONF_VENDOR='pc' -DSHELL -DHAVE_CONFIG_H  -D_FILE_OFFSET_BITS=64  -I. 
-I/usr/include -I/home/debian/src/bash/bash-2.05 
-I/home/debian/src/bash/bash-2.05/include -I/home/debian/src/bash/bash-2.05/lib 
-I/usr/include -g -O2
uname output: Linux jolie 2.4.5-xfs #8 Thu Jul 19 21:35:45 CEST 2001 i686 
unknown
Machine Type: i386-pc-linux-gnu

Bash Version: 2.05
Patch Level: 0
Release Status: release

Description:

#       Just that the following commands (when pasted to command-line) can be 
easier read...
                clear
#
#       Imagine the folder '/tmp/bla' whith the follwowing contest:
#               2 files named: "a aaaaa aaa.mp3" and "c - c.mp3"
#       (
                mkdir /tmp/bla;     touch "/tmp/bla/a aaaaa aaa.mp3";       
touch "/tmp/bla/c - c.mp3"
#       )
#
#       Now try to process all these files in a bash-script with the following 
commands:
#
                for a in `find /tmp/bla -iname "*.mp3" -printf "\"%f\" "`; do   
        echo "'$a'";            done
#               
#       It gives you:
#               '"a'
#               'aaaaa'
#               'aaa.mp3"'
#               '"c'
#               '-'
#               'c.mp3"'
#               
#       But I think it SHOULD BE:
#               'a aaaaa aaa.mp3'
#               'c - c.mp3'
#               
#       Because:
                tmp=`find /tmp/bla -iname "*.mp3" -printf "\"%p\""`;            
echo "tmp='$tmp'"
#       gives you:
#               tmp='"a aaaaa aaa.mp3" "c - c.mp3"'
#       And:
                for a in "a aaaaa aaa.mp3" "c - c.mp3"; do          echo 
"'$a'";            done
#       gives you:
#               'a aaaaa aaa.mp3'
#               'c - c.mp3'
#
#   And to clear it up at finish:
        rm -R /tmp/bla
                
###########################################################################################
#
#       Is this a bug or a feature?
#
#       Or (if it's NOT a bug): How is it possible to get the "SHOULD 
BE"-result ??? 
#       (Help would be VERY APRECIATED! - although I KNOW, that this is NOT the 
bash-help-line! 
#       - because I really think this is/should-be a bug...)
#
#
#       If it is NOT a bug, then please give me at least a short remark on that!
#   ( email: Posern@stud-mailer.uni-marburg.de )
#       This would be nice.
#
#   Thanks right now!
#
#    Greetings
#               
#               Knuth Posern
#

Repeat-By:
        [Describe the sequence of events that causes the problem
        to occur.]

        You can paste the above statements and read and see whats the problem 
        - for your pleasure ;-)

Fix:
        [Description of how to fix the problem.  If you don't know a
        fix for the problem, don't include this section.]

        No idea...




reply via email to

[Prev in Thread] Current Thread [Next in Thread]