Skip to content

Commit 886ad00

Browse files
authored
Merge pull request NixOS#5459 from andersk/echo-e
installer: Do not use echo -e in #!/bin/sh script
2 parents 647baaa + 447350f commit 886ad00

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

scripts/install-nix-from-closure.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -215,7 +215,7 @@ if [ -z "$NIX_INSTALLER_NO_MODIFY_PROFILE" ]; then
215215
if [ -w "$fn" ]; then
216216
if ! grep -q "$p" "$fn"; then
217217
echo "modifying $fn..." >&2
218-
echo -e "\nif [ -e $p ]; then . $p; fi # added by Nix installer" >> "$fn"
218+
printf '\nif [ -e %s ]; then . %s; fi # added by Nix installer\n' "$p" "$p" >> "$fn"
219219
fi
220220
added=1
221221
break
@@ -226,7 +226,7 @@ if [ -z "$NIX_INSTALLER_NO_MODIFY_PROFILE" ]; then
226226
if [ -w "$fn" ]; then
227227
if ! grep -q "$p" "$fn"; then
228228
echo "modifying $fn..." >&2
229-
echo -e "\nif [ -e $p ]; then . $p; fi # added by Nix installer" >> "$fn"
229+
printf '\nif [ -e %s ]; then . %s; fi # added by Nix installer\n' "$p" "$p" >> "$fn"
230230
fi
231231
added=1
232232
break

0 commit comments

Comments
 (0)