List in alphabetical order

This commit is contained in:
Guillaume Archambault 2024-08-03 09:49:25 +02:00
parent 951a717198
commit 6b16d90f84

View File

@ -43,7 +43,7 @@ EOF
ssh_manager_list() {
local config_file=~/.ssh/config
echo -e "\nList of SSH hosts:"
grep -E '^Host ' "$config_file" | awk '{print $2}' | grep -v '^#' | nl
grep -E '^Host ' "$config_file" | awk '{print $2}' | grep -v '^#' | sort | nl
echo -ne "\nEnter the number or name of the host (or press Enter to exit): "
read host