Based on your reasoning, it follows modified script :
#!/bin/bash
case "$1" in
-r) shuf "$2" ;;
-s) sort "$2" ;;
*) cat -n "$1" ;;
esac
Assuming you have an input file named frutas.txt
with the following content:
Banana
Laranja
Melancia
Limão
Maracujá
Maçã
Uva
Goiaba
Tangerina
Pêssego
1) Shuffling the lines of the input file:
$ ./processador.sh -r frutas.txt
Melancia
Maçã
Pêssego
Maracujá
Goiaba
Banana
Tangerina
Uva
Laranja
Limão
2) Sorting lines from the input file:
$ ./processador.sh -s frutas.txt
Banana
Goiaba
Laranja
Limão
Maçã
Maracujá
Melancia
Pêssego
Tangerina
Uva
3) Displaying the enumerated rows contained in the input file:
$ ./processador.sh frutas.txt
1 Banana
2 Laranja
3 Melancia
4 Limão
5 Maracujá
6 Maçã
7 Uva
8 Goiaba
9 Tangerina
10 Pêssego