Skip to content

Instantly share code, notes, and snippets.

@josenicomaia
Last active March 6, 2019 06:23
Show Gist options
  • Select an option

  • Save josenicomaia/5f14cbd80e031ea15eb9486a8c6cc271 to your computer and use it in GitHub Desktop.

Select an option

Save josenicomaia/5f14cbd80e031ea15eb9486a8c6cc271 to your computer and use it in GitHub Desktop.
#!/bin/bash
CONFIGURACOES=($(ls $HOME/.proxySelector-* | awk -F- '{print $2}'))
for i in ${!CONFIGURACOES[@]}; do
echo $(($i + 1))" - ${CONFIGURACOES[$i]}"
done
echo -n "Selecione uma opcao [1-${#CONFIGURACOES[@]}]: "
read -n 1 SELECIONADO
echo
CONFIG_SELECIONADA=${CONFIGURACOES[$((SELECIONADO - 1))]}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment