]> git.ipfire.org Git - thirdparty/openssh-portable.git/commitdiff
un-nest $() to make ksh cheerful
authorPhilip Hands <phil@hands.com>
Fri, 2 Oct 2020 22:20:07 +0000 (00:20 +0200)
committerDarren Tucker <dtucker@dtucker.net>
Fri, 2 Oct 2020 23:26:00 +0000 (09:26 +1000)
contrib/ssh-copy-id

index 11c9463ba51cb829c93d5e7e7a6bbf2d91fec316..ee3f6374cb07b2d9b22e36bd4f41791a9b2e98e5 100644 (file)
@@ -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;