[Fedora-xen] Re: (linux-br) Parâmetros em shell script

Leonardo Pinto listas at openlogic.com.br
Sat Jan 14 23:17:03 UTC 2006


Falou e disse camarada...

# ./tes a b c d e f g h i j k l
a, b, c, d, e, f, g, h, i, j, k, l

Essa foi a solução mais natural certamente:
echo ... ${10}, ${11}, ${12}

Tinha visto essas chaves em alguns scripts mais profissionais, e fiquei
sem entender. Agora “tudo” faz sentido. Mas só não entendi o por que dos
programadores utilizarem "indiscriminadamente" elas em todas as variáveis.

Sds,

--
Leonardo Pinto
listas#openlogic dot com br


> On Saturday 14 January 2006 19:24, Leonardo Pinto wrote:
> #!/bin/bash
> echo $1, $2, $3, $4, $5, $6, $7, $8, $9, $10, $11, $12
>
> Olá,
>
> $ ./tes a b c d e f g h i j k l
> a, b, c, d, e, f, g, h, i, a0, a1, a2
> a, b, c, d, e, f, g, h, i, j, k, l
>
> $ cat tes
> #!/bin/sh
> echo $1, $2, $3, $4, $5, $6, $7, $8, $9, $10, $11, $12
> echo ${1}, ${2}, ${3}, ${4}, ${5}, ${6}, ${7}, ${8}, ${9}, ${10}, ${11},
${12}
>
> Procure na net em algum tutorial de Shell Script por "parameter
substitution".
>
> Herbert.


________________________________________________
Mensagem enviada usando OpenLogic WebMail 2.7.2




More information about the Fedora-xen mailing list