|
From: | Fabiano Caixeta Duarte |
Subject: | Re: [shell-script] qual a diferença entre * e @ |
Date: | Wed, 17 Aug 2005 19:36:42 -0300 |
User-agent: | Mozilla Thunderbird 1.0.2 (X11/20050317) |
Retirado de `man bash` Special ParametersThe shell treats several parameters specially. These parameters may only be referenced; assignment to
them is not allowed.* Expands to the positional parameters, starting from one. When the expansion occurs within dou ble quotes, it expands to a single word with the value of each parameter separated by the first character of the IFS special variable. That is, "$*" is equivalent to "$1c$2c...", where c is the first character of the value of the IFS variable. If IFS is unset, the parameters are sepa rated by spaces. If IFS is null, the parameters are joined without intervening separators. @ Expands to the positional parameters, starting from one. When the expansion occurs within dou ble quotes, each parameter expands to a separate word. That is, "$@" is equivalent to "$1" "$2" ... When there are no positional parameters, "$@" and $@ expand to nothing (i.e., they are
removed). Fabiano Caixeta Duarte Consultor em soluções para Redes de Computadores (16) 9139-2258 Tiago Peczenyj escreveu:
L=( A B C D E F G H ) echo ${L[@]} A B C D E F G H echo ${L[*]} A B C D E F G H ??? --------------------------------------------------------------------- Esta lista não admite a abordagem de outras liguagens de programação, como perl, C etc. Quem insistir em não seguir esta regra será moderado sem prévio aviso. --------------------------------------------------------------------- Sair da lista: address@hidden --------------------------------------------------------------------- Esta lista é moderada de acordo com o previsto em http://www.listas-discussao.cjb.net --------------------------------------------------------------------- Links do Yahoo! Grupos
[Prev in Thread] | Current Thread | [Next in Thread] |