From cec6026bcb326f73310213f4fb958619a045c37f Mon Sep 17 00:00:00 2001 From: InigoGutierrez Date: Thu, 23 May 2019 13:32:14 +0200 Subject: Changed ssh.sh and scp.sh to allow for comments on hosts file. --- scp.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'scp.sh') diff --git a/scp.sh b/scp.sh index b01721f..27b23fd 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="$(cut -d'#' -f1 < "$hostsfile" | fzf)" +hostnames="$(sed '/^#.*$/d' < "$hostsfile" | cut -d'#' -f1 | fzf)" host="$(grep "$hostnames" < "$hostsfile")" hostname="$(echo "$host" | cut -d'#' -f1)" hostaddress="$(echo "$host" | cut -d'#' -f2)" -- cgit v1.2.1