Ipsissima verba Hue-Bond:
> Cesar Rincon, [EMAIL PROTECTED]:33:08(-0500):
> >
> >A=($DIR/*)
> 
> Esto me ha despistado. Lo �nico que veo en el man acerca de los
> par�ntesis es que su contenido se ejecuta en una subshell. Sin
> embargo, parece que t� est�s creando un array.

Bash es confuso a veces.  Los par�ntesis denotan ejecuci�n en
subshell, s�, salvo cuando van precedidos por una asignaci�n (nombre
de variable y signo 'igual qu�').  De la secci�n "Arrays" del manual
bash(1):

  "Arrays are assigned to using compound assignments of the form
  name=(value1 ... valuen), where each value is of the form [sub-
  script]=string.  Only string is required.  If the optional brackets
  and subscript are supplied, that index is assigned to; otherwise the
  index of the element assigned is the last index assigned to by the
  statement plus one.  Indexing starts at zero.  This syntax is also
  accepted by the declare builtin.  Individual array elements may be
  assigned to using the name[subscript]=value syntax introduced
  above."

De forma que tambi�n es v�lido

  A=([2]=dos [4]=cuatro [6]=seis)

para asignar los �ndices 2, 4 y 6 espec�ficamente.

Saluditos.

 -CR

Responder a