From 4f4b5f306e938ebe9ab3c6cd04c206e2eacc57fa Mon Sep 17 00:00:00 2001 From: Harsha Date: Tue, 27 Nov 2012 00:27:36 +0530 Subject: [PATCH 1/2] Built-in echo in ubuntu doesn't have an -e option echo -e option adds -e to .profile in ubuntu. --- doc/install/installation.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/install/installation.md b/doc/install/installation.md index 07ed0b0f9de..0da91103cac 100644 --- a/doc/install/installation.md +++ b/doc/install/installation.md @@ -96,7 +96,7 @@ Setup: cd /home/git sudo -u git -H mkdir bin - sudo -u git sh -c 'echo -e "PATH=\$PATH:/home/git/bin\nexport PATH" >> /home/git/.profile' + sudo -u git sh -c '/bin/echo -e "PATH=\$PATH:/home/git/bin\nexport PATH" >> /home/git/.profile' sudo -u git sh -c 'gitolite/install -ln /home/git/bin' sudo cp /home/gitlab/.ssh/id_rsa.pub /home/git/gitlab.pub -- GitLab From 78b2ccee39b751c8a58a0907dafba8a66fcca1f4 Mon Sep 17 00:00:00 2001 From: harsha Date: Wed, 28 Nov 2012 20:05:55 +0530 Subject: [PATCH 2/2] printf is more portable than echo If echo processes escape sequences by default, then it might treat -e as message rather than option. printf processes escape sequences more reliably than echo. Platforms may provide thier own version of echo than one from bin utils. And 'git' user uses /bin/sh as shell which could be bash or dash(ubuntu) or something else. --- doc/install/installation.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/install/installation.md b/doc/install/installation.md index 0da91103cac..028d42ff7d2 100644 --- a/doc/install/installation.md +++ b/doc/install/installation.md @@ -96,7 +96,7 @@ Setup: cd /home/git sudo -u git -H mkdir bin - sudo -u git sh -c '/bin/echo -e "PATH=\$PATH:/home/git/bin\nexport PATH" >> /home/git/.profile' + sudo -u git sh -c 'printf "PATH=\$PATH:/home/git/bin\nexport PATH" >> /home/git/.profile' sudo -u git sh -c 'gitolite/install -ln /home/git/bin' sudo cp /home/gitlab/.ssh/id_rsa.pub /home/git/gitlab.pub -- GitLab