From e58430b28340bb5cfa99be5247ac12eec52edee6 Mon Sep 17 00:00:00 2001 From: Konstantin Gorodinskiy Date: Sun, 1 Jan 2017 23:11:11 +0100 Subject: [PATCH] now sorts ssh sessions based on relevance(number of previous connections) --- README.md | 4 ++++ listbox | 2 +- ssh-connect.sh | 2 +- 3 files changed, 6 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 2897e20..5c8d8bd 100644 --- a/README.md +++ b/README.md @@ -10,6 +10,10 @@ git clone --recursive https://github.com/gko/ssh-connect source ./ssh-connect/ssh-connect.sh ``` +## Like it? + +:star: this repo + ## License [MIT](http://opensource.org/licenses/MIT) diff --git a/listbox b/listbox index 43ad4df..1ef816a 160000 --- a/listbox +++ b/listbox @@ -1 +1 @@ -Subproject commit 43ad4df14cf1a9dca8c508569ec0abfb2062c2f6 +Subproject commit 1ef816a62f4c7b825759f16de3df56ba197f699e diff --git a/ssh-connect.sh b/ssh-connect.sh index adb6862..7131273 100644 --- a/ssh-connect.sh +++ b/ssh-connect.sh @@ -3,7 +3,7 @@ source $(dirname "${BASH_SOURCE[0]}")/listbox/listbox.sh ssh-history() { - cat ~/.bash_history | grep -E "^ssh\s" | sed -e 's/[[:space:]]*$//' | sort -u + cat ~/.bash_history | grep -E "^ssh\s" | sed -e 's/\s*$//' | sort | uniq -c | sort -nr | sed -e "s/^\s*[0-9]*\s//" } ssh-connect() {