From ac5d20e21c3ed2ca3cd23cc207f164a10ff73efb Mon Sep 17 00:00:00 2001 From: Victor Lin <13424970+victorlin@users.noreply.github.com> Date: Fri, 28 Apr 2023 10:26:22 -0700 Subject: [PATCH] Add newline before eval command Previously, the command could result in unexpected errors if the shell init file did not end with a newline (for reasons beyond our control). If the file already ends with a newline, this comes with the added benefit of using whitespace to distinguish the "scope" of this command as separate from whatever was there before. Use printf to ensure '\n' is expanded in bash, zsh, and hopefully all other shells. --- bin/standalone-installer-unix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bin/standalone-installer-unix b/bin/standalone-installer-unix index 0f5ecea9..08c1aaad 100755 --- a/bin/standalone-installer-unix +++ b/bin/standalone-installer-unix @@ -92,7 +92,7 @@ Nextstrain CLI ($installed_version) installed to $DESTINATION. To make the "nextstrain" command available in your default shell ($shell) without using the full path, please run these two commands now: - echo 'eval "\$("$DESTINATION/nextstrain" init-shell $shell)"' >> $rc + printf '\n%s\n' 'eval "\$("$DESTINATION/nextstrain" init-shell $shell)"' >> $rc eval "\$("$DESTINATION/nextstrain" init-shell $shell)" The first adds a line to your shell initialization file ($rc) for future