Oleksandr Gavenko wrote:
>    $ var="--opt arg 'arg-part1 arg2-part2'"
>    $ printarg $var

А printarg -- это откуда?

> Еще ограничение POSIX shell:
> 
> bash# foo=bar
> bash# bar=xxx
> bash# echo ${${foo}}
> bash: ${${foo}}: bad substitution
> 
> или
> 
> bash# foo1=xxx
> bash# foo2=yyy
> bash# var=1
> bash# echo ${foo${var}}
> bash: ${foo${var}}: bad substitution

В bash-е для этого используется синтаксис ${!foo}.

В POSIX shell -- наверное только через eval (или субшелл).



-- 
To UNSUBSCRIBE, email to [email protected]
with a subject of "unsubscribe". Trouble? Contact [email protected]
Archive: http://lists.debian.org/[email protected]

Ответить