Skip to content

Commit

Permalink
Sort Menu to alphabetic order #1
Browse files Browse the repository at this point in the history
  • Loading branch information
brfso committed Aug 23, 2014
1 parent 27da714 commit b16a2aa
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions conservers.sh
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ if [ ! -f "$SERVERS_LIST" ] || [ "${1}" == '-a' ];
return_code
fi

EMPRESAS=$(egrep '^(.*;){3}[0-9]+;[^;]+$' "${SERVERS_LIST}" | grep -v ^# | awk -F";" '{print $1}' | uniq)
EMPRESAS=$(egrep '^(.*;){3}[0-9]+;[^;]+$' "${SERVERS_LIST}" | grep -v ^# | awk -F";" '{print $1}' | sort -d | uniq)
clear
select selectedEmploye in $EMPRESAS; do
Expand All @@ -36,7 +36,7 @@ select selectedEmploye in $EMPRESAS; do
echo "Opção Inválida, Digite a opção correta ou Crtl + C para sair: "
else
clear
HOST=$(egrep '^(.*;){3}[0-9]+;[^;]+$' "${SERVERS_LIST}" | grep -v ^# | grep -w $selectedEmploye | awk -F";" '{print $5}' | uniq)
HOST=$(egrep '^(.*;){3}[0-9]+;[^;]+$' "${SERVERS_LIST}" | grep -v ^# | grep -w $selectedEmploye | awk -F";" '{print $5}' | sort -d | uniq)
echo "Selecione o servidor no qual você deseja se conectar: "
select selectedHost in $HOST; do
Expand Down

0 comments on commit b16a2aa

Please sign in to comment.