Ver Mensaje Individual
  #1 (permalink)  
Antiguo 29/08/2007, 10:00
m.mojon
 
Fecha de Ingreso: agosto-2007
Mensajes: 30
Antigüedad: 16 años, 8 meses
Puntos: 0
duda shellscript

hola, tengo problemas con un script, es este;

#!/bin/sh
for aux in `cat prueba.txt`
do
if $aux = 9
then
echo $aux
fi
done

el fichero prueba.txt contiene numeros del 1 al 12 y con el if quiero que sólo me saque el 9, pero me muestra el error;

./prueba.sh: 8: 1: not found
./prueba.sh: 8: 2: not found
./prueba.sh: 8: 3: not found
./prueba.sh: 8: 4: not found
./prueba.sh: 8: 5: not found
./prueba.sh: 8: 6: not found
./prueba.sh: 8: 7: not found
./prueba.sh: 8: 8: not found
./prueba.sh: 8: 9: not found
./prueba.sh: 8: 10: not found
./prueba.sh: 8: 11: not found
./prueba.sh: 8: 12: not found

como puedo hacer para que me muestre solo el 9, gracias.