Ver Mensaje Individual
  #11 (permalink)  
Antiguo 30/06/2010, 17:53
Avatar de maturano
maturano
 
Fecha de Ingreso: enero-2010
Ubicación: /home/
Mensajes: 537
Antigüedad: 14 años, 3 meses
Puntos: 36
Respuesta: Ayuda con variables en script en bash

Código Bash:
Ver original
  1. #!/bin/bash
  2.  
  3. texto1='Este es el texto 1'
  4. texto2='Este es el texto 2'
  5. texto3='Este es el texto 3'
  6.  
  7. echo ${!1}

Código:
$ ./archivo.sh texto1
Este es el texto 1
$./archivo.sh texto3
Este es el texto 3
Búscalo como "indirect expansion" (técnicamente correcto) o como "variables variables" . Punto 3.4.4:
http://tldp.org/LDP/Bash-Beginners-G...ect_03_04.html
__________________
I ♥ The Music!