From 9ccf8699ecf5126d503e22f6ecafb52edd5b1ac3 Mon Sep 17 00:00:00 2001 From: bretello Date: Mon, 10 Jul 2023 09:12:50 +0200 Subject: [PATCH] zsh: functions: fix upload() --- functions/misc.zsh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/functions/misc.zsh b/functions/misc.zsh index eef0459..4f4feed 100755 --- a/functions/misc.zsh +++ b/functions/misc.zsh @@ -121,14 +121,14 @@ function upload echo -e "Done, file at:\t$out" if [[ $(uname) == "Darwin" ]]; then clipboard="pbcopy" - elif command -v wl-copy; then + elif command -v wl-copy &>/dev/null; then clipboard="wl-copy" - elif command -v xclip; then + elif command -v xclip &>/dev/null ; then clipboard="xclip" else clipboard="cat" fi - echo -n"$out" | $clipboard + echo -en "$out" | $clipboard } ## If connecting through ssh and reverse forwarding port 2222 (ssh -R 2222:localhost:22 ), this function allows to copy the files back to the machine one is connecting from by typing 'mecp filename' (configure the username for "localhost" in ~/.ssh/config or add an username)