Skip to content

Commit

Permalink
Use printf in favor of echo for reproducibility (#83)
Browse files Browse the repository at this point in the history
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
  • Loading branch information
mouadino authored and tonivdv committed Dec 1, 2017
1 parent 93eab32 commit eebf3d4
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion docker-machine-nfs.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down

0 comments on commit eebf3d4

Please sign in to comment.