Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/bin/bash
- # Te muestra un personaje aleatorio, con una frase
- # aleatoria.
- #
- # Puedes incluirlo en tu archivo de configuracion
- # de shell, para que cad vez que inicies sesion,
- # inicies de una manera diferente.
- #
- # Dependencias:
- # cowsay
- # fortune
- max_file=$(ls -1 /usr/share/cows/ | wc -l)
- indice=0
- let random_val=${RANDOM}%${max_file}
- for i in /usr/share/cows/*;
- do
- let indice=${indice}+1;
- if [ ${indice} -eq ${random_val} ]; then
- fortune | cowsay -f ${i};
- break
- fi
- done
Add Comment
Please, Sign In to add comment