BASH – Script menu dinamico.-

El constructor select reproduce el menú de forma permanente incluso después de haber finalizado con las instrucciones internas. La instrucción break romperá ese bucle.

#!/bin/bash
OPCIONES="Abrir Cerrar Editar Borrar Guardar Salir"
PS3="Elija una opción: "
select opcion in $OPCIONES; do
if [ $opcion ]; then
echo "Usted Eligió la opción $opcion"
break
fi
done
Esta entrada fue publicada en Unix - Linux. Guarda el enlace permanente.