On 2006-11-21, Ian Jackson wrote: > Oleg Verych writes ("Re: Question about "Depends: bash""): >> o `arrays' bashizm -> tmp=$@ ; set -- $ARRAY ; use_array $@ ; set -- $tmp > > This is another piece of bad advice: this approach is buggy if the > arguments might contain whitespace, which is often the case (eg if > they're filename arguments).
Who said, that it's without bugs, bugs of my usage or bugs in BaSH, dash? "NO WARRANTY" message on every login (:? (BTW, spaces in filenames are problem of those dual-boots, who have non UTC BIOS time and such.) IFS doesn't help there. Why? Quotes can't help against _some_ contents of $ARRAY (in example above). While i don't know how it should be, please, comment on below experiment, which i think shows a bug: ,-*- bash -*- |[EMAIL PROTECTED]:/tmp/b$ touch simple.file |[EMAIL PROTECTED]:/tmp/b$ echo * |simple.file |[EMAIL PROTECTED]:/tmp/b$ echo '*' |* |[EMAIL PROTECTED]:/tmp/b$ set -- * ; echo $1 |simple.file |[EMAIL PROTECTED]:/tmp/b$ set -- '*' ; echo $1 |simple.file |[EMAIL PROTECTED]:/tmp/b$ set -- '\*' ; echo $1 |\* |[EMAIL PROTECTED]:/tmp/b$ set -- \* ; echo $1 |simple.file |[EMAIL PROTECTED]:/tmp/b$ set -- \\* ; echo $1 |\* |[EMAIL PROTECTED]:/tmp/b$ `-*- dash does the same way, `-f' option helps there, while its meaning for `echo' and `set' seems to be different. ____ -- To UNSUBSCRIBE, email to [EMAIL PROTECTED] with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]