Hallo, Am Fre, 27 Feb 2009, Al Bogner schrieb:
da habe ich mich wohl selber reingelegt. Im Script selber quote ich, für eine Anzeige beim Debugging habe ich mir das gespart. Ist dieses Verhalten eigentlich ein Bug oder ein Feature?
Dokumentiertes Feature. ==== man bash ==== Word Splitting [..] If IFS is unset, or its value is exactly <space><tab><newline>, the default, then any sequence of IFS characters serves to delimit words. [..] EXPANSION Expansion is performed on the command line after it has been split into words. [..] echo [-neE] [arg ...] Output the args, separated by spaces, followed by a newline. ==== Dein $var wird also expandiert (mit den 2 Leerzeichen) aber dann als MEHRERE Argumente an echo übergeben. $ set -x; v="a b c"; echo $v + v=a b c + echo a b c a b c $ echo "$v" + v=a b c + echo 'a b c' a b c Der entscheidende Unterschied ist, daß echo _ein_ durch '' geschütztes Argument zu sehen bekommt. Und was bete ich hier ständig? Quote immer deine Variablen! -dnh -- Oh, please. The Pentagon's lost entire countries. -- Col. O'Neill -- Um die Liste abzubestellen, schicken Sie eine Mail an: opensuse-de+unsubscribe@opensuse.org Um eine Liste aller verfuegbaren Kommandos zu bekommen, schicken Sie eine Mail an: opensuse-de+help@opensuse.org