diff options
author | Philip Hands <phil@hands.com> | 2024-07-31 23:15:11 +0200 |
---|---|---|
committer | Darren Tucker <dtucker@dtucker.net> | 2024-08-17 03:19:29 +0200 |
commit | b3f91411fd1473605f74c40c1a91a024c7171e27 (patch) | |
tree | 096d74db6a41445cb4a2d673a75b5bb0127d6ccf /contrib | |
parent | avoid extra space when no arg given to -i option (diff) | |
download | openssh-b3f91411fd1473605f74c40c1a91a024c7171e27.tar.xz openssh-b3f91411fd1473605f74c40c1a91a024c7171e27.zip |
ensure ERROR output goes to STDERR
SSH-Copy-ID-Upstream: ac394b05eead3b91feb7c2ae4129a3e9b892f1e2
Diffstat (limited to 'contrib')
-rw-r--r-- | contrib/ssh-copy-id | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/contrib/ssh-copy-id b/contrib/ssh-copy-id index 8c84385d3..0b12381e2 100644 --- a/contrib/ssh-copy-id +++ b/contrib/ssh-copy-id @@ -56,7 +56,7 @@ then a bug describing your setup, and the shell you used to make it work. EOF - printf '%s: ERROR: Less dimwitted shell required.\n' "$0" + printf '%s: ERROR: Less dimwitted shell required.\n' "$0" >&2 exit 1 fi fi @@ -86,7 +86,7 @@ use_id_file() { L_ID_FILE="$1" if [ -z "$L_ID_FILE" ] ; then - printf '%s: ERROR: no ID file found\n' "$0" + printf '%s: ERROR: no ID file found\n' "$0" >&2 exit 1 fi @@ -103,7 +103,7 @@ use_id_file() { ErrMSG=$( { : < "$f" ; } 2>&1 ) || { L_PRIVMSG="" [ "$f" = "$PRIV_ID_FILE" ] && L_PRIVMSG=" (to install the contents of '$PUB_ID_FILE' anyway, look at the -f option)" - printf "\\n%s: ERROR: failed to open ID file '%s': %s\\n" "$0" "$f" "$(printf '%s\n%s\n' "$ErrMSG" "$L_PRIVMSG" | sed -e 's/.*: *//')" + printf "\\n%s: ERROR: failed to open ID file '%s': %s\\n" "$0" "$f" "$(printf '%s\n%s\n' "$ErrMSG" "$L_PRIVMSG" | sed -e 's/.*: *//')" >&2 exit 1 } done @@ -120,7 +120,7 @@ do case "$OPT" in i) [ "${SEEN_OPT_I}" ] && { - printf '\n%s: ERROR: -i option must not be specified more than once\n\n' "$0" + printf '\n%s: ERROR: -i option must not be specified more than once\n\n' "$0" >&2 usage } SEEN_OPT_I="yes" |