better awk syntax for ssh-config as well as better sorting for dmenu in dmenu_ssh
This commit is contained in:
parent
ae43b3a597
commit
a88e99bcf2
1 changed files with 2 additions and 2 deletions
|
@ -5,9 +5,9 @@ cmd=$1
|
||||||
shift
|
shift
|
||||||
get_hosts() {
|
get_hosts() {
|
||||||
awk -F",| " '{print $1}' "${HOME}/.ssh/known_hosts"
|
awk -F",| " '{print $1}' "${HOME}/.ssh/known_hosts"
|
||||||
awk '{if ($1 == "Host") print $2}' "${HOME}/.ssh/config"
|
awk '$1 == "Host" {print $2}' "${HOME}/.ssh/config"
|
||||||
}
|
}
|
||||||
result=$(get_hosts | sort -u | dmenu -p ssh ${1+"$@"}) || exit 1
|
result=$(get_hosts | sort -uV | dmenu -p ssh ${1+"$@"}) || exit 1
|
||||||
exec $cmd $result
|
exec $cmd $result
|
||||||
|
|
||||||
# call from ~/.i3/config:
|
# call from ~/.i3/config:
|
||||||
|
|
Loading…
Reference in a new issue