diff options
author | Philip Hands <phil@hands.com> | 2020-10-03 00:20:07 +0200 |
---|---|---|
committer | Darren Tucker <dtucker@dtucker.net> | 2020-10-03 01:26:00 +0200 |
commit | ce941c75ea9cd6c358508a5b206809846c8d9240 (patch) | |
tree | 3c05be31a2c0020bd6a35fbe17149cadc462a2f2 /contrib/ssh-copy-id | |
parent | ksh doesn't grok 'local' (diff) | |
download | openssh-ce941c75ea9cd6c358508a5b206809846c8d9240.tar.xz openssh-ce941c75ea9cd6c358508a5b206809846c8d9240.zip |
un-nest $() to make ksh cheerful
Diffstat (limited to 'contrib/ssh-copy-id')
-rw-r--r-- | contrib/ssh-copy-id | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/contrib/ssh-copy-id b/contrib/ssh-copy-id index 11c9463ba..ee3f6374c 100644 --- a/contrib/ssh-copy-id +++ b/contrib/ssh-copy-id @@ -237,6 +237,7 @@ populate_new_ids() { # optionally takes an alternative path for authorized_keys installkeys_sh() { AUTH_KEY_FILE=${1:-.ssh/authorized_keys} + AUTH_KEY_DIR=$(dirname "${AUTH_KEY_FILE}") # In setting INSTALLKEYS_SH: # the tr puts it all on one line (to placate tcsh) @@ -249,7 +250,7 @@ installkeys_sh() { INSTALLKEYS_SH=$(tr '\t\n' ' ' <<-EOF cd; umask 077; - mkdir -p $(dirname "${AUTH_KEY_FILE}") && + mkdir -p "${AUTH_KEY_DIR}" && { [ -z \`tail -1c ${AUTH_KEY_FILE} 2>/dev/null\` ] || echo >> ${AUTH_KEY_FILE}; } && cat >> ${AUTH_KEY_FILE} || exit 1; |