From d0b69c9376dc06e36803486e83911510e02e0a3b Mon Sep 17 00:00:00 2001 From: "W. Trevor King" Date: Fri, 22 Feb 2013 11:33:10 -0500 Subject: [PATCH] Makefile: Use the more portable printf over `echo -e` See POSIX-2008 for details: http://pubs.opengroup.org/onlinepubs/9699919799/utilities/echo.html http://pubs.opengroup.org/onlinepubs/9699919799/utilities/printf.html --- Makefile | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/Makefile b/Makefile index ec3bc3e..45ccbba 100644 --- a/Makefile +++ b/Makefile @@ -145,23 +145,23 @@ run: angle-vs-y0.png time-vs-y0.png trajectories.png \ .SECONDEXPANSION: final-vs-y0.data: scatter - echo -e "# y0\ttime\tangle\tenergy" > "$@" + printf "# y0\ttime\tangle\tenergy\n" > "$@" for y0 in $$(seq 0 0.0008 0.8); do \ - echo -en "$$y0\t" >> "$@"; \ + printf "%s\t" "$$y0" >> "$@"; \ ./scatter --y0 "$$y0" --final >> "$@"; \ done .SECONDEXPANSION: final-vs-y0-zoom.data: scatter - echo -e "# y0\ttime\tangle\tenergy" > "$@" + printf "# y0\ttime\tangle\tenergy\n" > "$@" for y0 in $$(seq 0.2772 0.0000008 0.2780); do \ - echo -en "$$y0\t" >> "$@"; \ + printf "%s\t" "$$y" >> "$@"; \ ./scatter --y0 "$$y0" --final >> "$@"; \ done .SECONDEXPANSION: trajectories.data: scatter - echo -e "# t\tx\ty\tv_x\tv_y\tenergy" > "$@" + printf "# time\tx\ty\tv_x\tv_y\tenergy\n" > "$@" for y0 in 0.024 0.0312 0.277672 0.277776 0.2784 0.3024; do \ ./scatter --y0 "$$y0" >> "$@"; \ echo '' >> "$@"; \ @@ -172,10 +172,10 @@ trajectories.data: scatter # for E in $$(seq 0.1 0.00107421875 1.2); do .SECONDEXPANSION: final-vs-y0-E.data: scatter - echo -e "# y0\tinitial energy\ttime\tangle\tenergy" > "$@" + printf "# y0\tinitial energy\ttime\tangle\tenergy\n" > "$@" for y0 in $$(seq 0.0 0.1 0.8); do \ for E in $$(seq 0.1 0.1 1.2); do \ - echo -en "$$y0\t$$E\t" >> "$@"; \ + printf "%s\t%s\t" "$$y0" "$$E" >> "$@"; \ ./scatter --y0 "$$y0" --vx0-energy "$$E" --final >> "$@"; \ done \ done -- 2.26.2