From b8d66986e9be6711ed42f0b75de3af2e1f4a632d Mon Sep 17 00:00:00 2001 From: InigoGutierrez Date: Sun, 15 Dec 2019 23:01:28 +0100 Subject: ssh.sh and scp.sh now don't show blank options. --- scp.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'scp.sh') diff --git a/scp.sh b/scp.sh index ca6769b..6365187 100755 --- a/scp.sh +++ b/scp.sh @@ -2,7 +2,7 @@ # Allows to select a host to send files to through scp hostsfile="$HOME/.hosts" -hostnames="$(sed '/^#.*$/d' < "$hostsfile" | cut -d'#' -f1 | fzf)" || exit 0 +hostnames="$(sed '/^#.*$/d; /^$/d' < "$hostsfile" | cut -d'#' -f1 | fzf)" || exit 0 host="$(grep "$hostnames" < "$hostsfile")" hostname="$(echo "$host" | cut -d'#' -f1)" hostaddress="$(echo "$host" | cut -d'#' -f2)" -- cgit v1.2.1