From eebf3d44094e4d1a0e2864100cf4ba2300dfadd5 Mon Sep 17 00:00:00 2001 From: Mouad Benchchaoui Date: Fri, 1 Dec 2017 08:27:03 +0100 Subject: [PATCH] Use printf in favor of echo for reproducibility (#83) In my machine, echo will lead to literally having \n in /etc/exports file which will lead the nfs server to fail starting, this is due to the echo version that I have locally, while printf doesn't have this issue as explained here: https://stackoverflow.com/questions/8467424/echo-newline-in-bash-prints-literal-n --- docker-machine-nfs.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docker-machine-nfs.sh b/docker-machine-nfs.sh index 14711c5..673b0de 100755 --- a/docker-machine-nfs.sh +++ b/docker-machine-nfs.sh @@ -360,7 +360,7 @@ configureNFS() # Write new exports block ending exports="${exports}${exports_end}" #Export to file - echo "$exports" | sudo tee /etc/exports >/dev/null + printf "$exports" | sudo tee /etc/exports >/dev/null sudo nfsd restart ; sleep 2 && sudo nfsd checkexports