|
@@ -1,7 +1,7 @@
|
|
|
#!/bin/zsh
|
|
#!/bin/zsh
|
|
|
-LOCATIONS=$(grep -ioE "ssh [a-z0-9]+@[a-z0-9]+\.[a-z0-9]+" $ZDOTDIR/.zsh_history | cut -c 5- | uniq)
|
|
|
|
|
|
|
+LOCATIONS=$(grep -ioE "^ssh [a-z0-9]+@[a-z0-9\.]+" $ZDOTDIR/.zsh_history | tac | awk '!x[$0]++' | cut -c 5-)
|
|
|
if [[ $1 =~ '^[0-9]+$' ]] ; then
|
|
if [[ $1 =~ '^[0-9]+$' ]] ; then
|
|
|
- echo $(echo $LOCATIONS | tac | head -n $1)
|
|
|
|
|
|
|
+ echo $LOCATIONS | head -n $1
|
|
|
exit
|
|
exit
|
|
|
fi
|
|
fi
|
|
|
if [[ -z "$1" ]]; then
|
|
if [[ -z "$1" ]]; then
|