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

bash features (Re: Question about "Depends: bash")



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 -*-
|olecom@deen:/tmp/b$ touch simple.file
|olecom@deen:/tmp/b$ echo *
|simple.file
|olecom@deen:/tmp/b$ echo '*'
|*
|olecom@deen:/tmp/b$ set -- * ; echo $1
|simple.file
|olecom@deen:/tmp/b$ set -- '*' ; echo $1
|simple.file
|olecom@deen:/tmp/b$ set -- '\*' ; echo $1
|\*
|olecom@deen:/tmp/b$ set -- \* ; echo $1
|simple.file
|olecom@deen:/tmp/b$ set -- \\* ; echo $1
|\*
|olecom@deen:/tmp/b$
`-*-

dash does the same way, `-f' option helps there, while its meaning for
`echo' and `set' seems to be different.
____



Reply to: