Commit b6000ac0 authored by thomas.forbriger's avatar thomas.forbriger
Browse files

[WP] (issue14): replace echo -e by printf

The echo shell builtin of the traditional Bourne Shell does not recognize the
-e option. Better use printf in this case.

From the POSIX manual for printf:

RATIONALE
  The printf utility was added to provide functionality that has histori-
  cally been provided by echo. However, due to irreconcilable differ-
  ences in the various versions of echo extant, the version has few special
  features, leaving those to this new printf utility, which is based on one in
  the Ninth Edition system.
parent 8d7894a6
......@@ -7,36 +7,37 @@
#
# REVISIONS and CHANGES
# 12/05/2015 V1.0 Thomas Forbriger
# 26/10/2015 V1.1 use printf instead of echo
#
# ============================================================================
#
#----------------------------------------------------------------------
# integration filter
%.int.bin: %.bin
echo -e "int 0\nend" | tidofi -v -o -cs \
printf "int 0\nend\n" | tidofi -v -o -cs \
-type bin -Type bin $@ $<
# alternative integration filter
%.inta.bin: %.bin
echo -e "int 0\nend" | tidofi -v -o -cs \
printf "int 0\nend\n" | tidofi -v -o -cs \
-type bin -Type bin $@ $<
# double integration filter
%.int2.bin: %.bin
echo -e "int 0\nint 0\nend" | tidofi -v -o -cs \
printf "int 0\nint 0\nend\n" | tidofi -v -o -cs \
-type bin -Type bin $@ $<
# derivative filter
%.dif.bin: %.bin
echo -e "dif 0\nend" | tidofi -v -o -cs \
printf "dif 0\nend\n" | tidofi -v -o -cs \
-type bin -Type bin $@ $<
# produce baseline for plot
%.baseline.bin: %.bin
echo -e "fac 0.\nend" | tidofi -v -o -cs \
printf "fac 0.\nend\n" | tidofi -v -o -cs \
-type bin -Type bin $@ $<
# low-pass filter
LPCMD=lpb 0.1,4
%.lp.bin: %.bin
echo -e "$(LPCMD)\nend" | tidofi -v -o -cs \
printf "$(LPCMD)\nend\n" | tidofi -v -o -cs \
-type bin -Type bin $@ $<
# filter
......@@ -45,13 +46,13 @@ HP=0.25
LPFILTER=lpb $(LP),2
HPFILTER=hpb $(HP),2
%.fil.bin: %.bin
echo -e "$(LPFILTER)\n$(HPFILTER)\nend" |\
printf "$(LPFILTER)\n$(HPFILTER)\nend\n" |\
tidofi -v -o --type bin --Type bin -cs \
$@ $<
# reverse polarity
%.inv.bin: %.bin
echo -e "fac -1.\nend" | tidofi -v -o -cs \
printf "fac -1.\nend\n" | tidofi -v -o -cs \
-type bin -Type bin $@ $<
# ----- END OF Makefile.filter -----
......@@ -8,6 +8,7 @@
# REVISIONS and CHANGES
# 12/05/2015 V1.0 Thomas Forbriger
# 07/07/2015 V1.1 provide test data with sparse receiver array
# 26/10/2015 V1.2 use printf instead of echo
#
# ============================================================================
#
......@@ -39,7 +40,7 @@ srcpulsespec.ps: srcpulse.sff
%.PZ.bin %.PR.bin: %.main %.dmod \
zforce.src lin.rcv
refmetx -v -4 -c -o $(patsubst %.main,%,$<) -ty bin $<
echo -e "fac -1.\nend" | tidofi -v -o -cs -type bin -Type bin \
printf "fac -1.\nend\n" | tidofi -v -o -cs -type bin -Type bin \
$(patsubst %.main,%,$<).PZ.bin $(patsubst %.main,%,$<).TZ
/bin/rm -fv $(patsubst %.main,%,$<).TZ
/bin/mv -fv $(patsubst %.main,%,$<).TR $(patsubst %.main,%,$<).PR.bin
......@@ -48,7 +49,7 @@ srcpulsespec.ps: srcpulse.sff
%.LZ.bin %.LR.bin: %.main %.dmod \
zforce.src lin.rcv
refmetx -v -4 -c -o $(patsubst %.main,%,$<) -ty bin -l $<
echo -e "fac -1.\nend" | tidofi -v -o -cs -type bin -Type bin \
printf "fac -1.\nend\n" | tidofi -v -o -cs -type bin -Type bin \
$(patsubst %.main,%,$<).LZ.bin $(patsubst %.main,%,$<).TZ
/bin/rm -fv $(patsubst %.main,%,$<).TZ
/bin/mv -fv $(patsubst %.main,%,$<).TR $(patsubst %.main,%,$<).LR.bin
......@@ -56,14 +57,14 @@ srcpulsespec.ps: srcpulse.sff
acousticfs.PZ.bin acousticfs.PR.bin: acousticfs.main fullspace.dmod \
exp0.src lin.rcv
refmetx -v -4 -c -o $(patsubst %.main,%,$<) -ty bin $<
echo -e "fac -1.\nend" | tidofi -v -o -cs -type bin -Type bin \
printf "fac -1.\nend\n" | tidofi -v -o -cs -type bin -Type bin \
$(patsubst %.main,%,$<).PZ.bin $(patsubst %.main,%,$<).TZ
/bin/rm -fv $(patsubst %.main,%,$<).TZ
/bin/cp -fv $(patsubst %.main,%,$<).TR $(patsubst %.main,%,$<).PR.bin
acousticfs.LZ.bin acousticfs.LR.bin: acousticfs.main fullspace.dmod \
exp0.src lin.rcv
refmetx -v -4 -c -o $(patsubst %.main,%,$<) -ty bin -l $<
echo -e "fac -1.\nend" | tidofi -v -o -cs -type bin -Type bin \
printf "fac -1.\nend\n" | tidofi -v -o -cs -type bin -Type bin \
$(patsubst %.main,%,$<).LZ.bin $(patsubst %.main,%,$<).TZ
/bin/rm -fv $(patsubst %.main,%,$<).TZ
/bin/cp -fv $(patsubst %.main,%,$<).TR $(patsubst %.main,%,$<).LR.bin
......@@ -74,7 +75,7 @@ biet000601.deepsrc.PZ.bin biet000601.deepsrc.PR.bin: biet000601.deepsrc.main \
biet000601.dmod \
zforce15.src lin.rcv
refmetx -v -4 -c -o $(patsubst %.main,%,$<) -ty bin $<
echo -e "fac -1.\nend" | tidofi -v -o -cs -type bin -Type bin \
printf "fac -1.\nend\n" | tidofi -v -o -cs -type bin -Type bin \
$(patsubst %.main,%,$<).PZ.bin $(patsubst %.main,%,$<).TZ
/bin/rm -fv $(patsubst %.main,%,$<).TZ
/bin/cp -fv $(patsubst %.main,%,$<).TR $(patsubst %.main,%,$<).PR.bin
......@@ -84,7 +85,7 @@ biet000601.deepsrc.LZ.bin biet000601.deepsrc.LR.bin: biet000601.deepsrc.main \
biet000601.dmod \
zforce15.src lin.rcv
refmetx -v -4 -c -o $(patsubst %.main,%,$<) -ty bin -l $<
echo -e "fac -1.\nend" | tidofi -v -o -cs -type bin -Type bin \
printf "fac -1.\nend\n" | tidofi -v -o -cs -type bin -Type bin \
$(patsubst %.main,%,$<).LZ.bin $(patsubst %.main,%,$<).TZ
/bin/rm -fv $(patsubst %.main,%,$<).TZ
/bin/cp -fv $(patsubst %.main,%,$<).TR $(patsubst %.main,%,$<).LR.bin
......@@ -95,7 +96,7 @@ biet000601.exp.PZ.bin biet000601.exp.PR.bin: biet000601.exp.main \
biet000601.dmod \
exp.src lin.rcv
refmetx -v -4 -c -o $(patsubst %.main,%,$<) -ty bin $<
echo -e "fac -1.\nend" | tidofi -v -o -cs -type bin -Type bin \
printf "fac -1.\nend\n" | tidofi -v -o -cs -type bin -Type bin \
$(patsubst %.main,%,$<).PZ.bin $(patsubst %.main,%,$<).TZ
/bin/rm -fv $(patsubst %.main,%,$<).TZ
/bin/cp -fv $(patsubst %.main,%,$<).TR $(patsubst %.main,%,$<).PR.bin
......@@ -105,7 +106,7 @@ biet000601.exp.LZ.bin biet000601.exp.LR.bin: biet000601.exp.main \
biet000601.dmod \
exp.src lin.rcv
refmetx -v -4 -c -o $(patsubst %.main,%,$<) -ty bin -l $<
echo -e "fac -1.\nend" | tidofi -v -o -cs -type bin -Type bin \
printf "fac -1.\nend\n" | tidofi -v -o -cs -type bin -Type bin \
$(patsubst %.main,%,$<).LZ.bin $(patsubst %.main,%,$<).TZ
/bin/rm -fv $(patsubst %.main,%,$<).TZ
/bin/cp -fv $(patsubst %.main,%,$<).TR $(patsubst %.main,%,$<).LR.bin
......@@ -119,7 +120,7 @@ biet.zforce.sparse.PZ.bin biet.zforce.sparse.PR.bin: \
biet.zforce.sparse.main biet000601.dmod \
zforce.src lin.rcv
refmetx -v -4 -c -o $(patsubst %.main,%,$<) -ty bin $<
echo -e "fac -1.\nend" | tidofi -v -o -cs -type bin -Type bin \
printf "fac -1.\nend\n" | tidofi -v -o -cs -type bin -Type bin \
$(patsubst %.main,%,$<).PZ.bin $(patsubst %.main,%,$<).TZ
/bin/rm -fv $(patsubst %.main,%,$<).TZ
/bin/mv -fv $(patsubst %.main,%,$<).TR $(patsubst %.main,%,$<).PR.bin
......@@ -129,7 +130,7 @@ biet.zforce.sparse.LZ.bin biet.zforce.sparse.LR.bin: \
biet.zforce.sparse.main biet000601.dmod \
zforce.src lin.rcv
refmetx -v -4 -c -o $(patsubst %.main,%,$<) -ty bin -l $<
echo -e "fac -1.\nend" | tidofi -v -o -cs -type bin -Type bin \
printf "fac -1.\nend\n" | tidofi -v -o -cs -type bin -Type bin \
$(patsubst %.main,%,$<).LZ.bin $(patsubst %.main,%,$<).TZ
/bin/rm -fv $(patsubst %.main,%,$<).TZ
/bin/mv -fv $(patsubst %.main,%,$<).TR $(patsubst %.main,%,$<).LR.bin
......@@ -142,7 +143,7 @@ fs.zforce0.sparse.PZ.bin fs.zforce0.sparse.PR.bin: \
fs.zforce0.sparse.main fullspace.dmod \
zforce0.src lin.rcv
refmetx -v -4 -c -o $(patsubst %.main,%,$<) -ty bin $<
echo -e "fac -1.\nend" | tidofi -v -o -cs -type bin -Type bin \
printf "fac -1.\nend\n" | tidofi -v -o -cs -type bin -Type bin \
$(patsubst %.main,%,$<).PZ.bin $(patsubst %.main,%,$<).TZ
/bin/rm -fv $(patsubst %.main,%,$<).TZ
/bin/mv -fv $(patsubst %.main,%,$<).TR $(patsubst %.main,%,$<).PR.bin
......@@ -152,7 +153,7 @@ fs.zforce0.sparse.LZ.bin fs.zforce0.sparse.LR.bin: \
fs.zforce0.sparse.main fullspace.dmod \
zforce0.src lin.rcv
refmetx -v -4 -c -o $(patsubst %.main,%,$<) -ty bin -l $<
echo -e "fac -1.\nend" | tidofi -v -o -cs -type bin -Type bin \
printf "fac -1.\nend\n" | tidofi -v -o -cs -type bin -Type bin \
$(patsubst %.main,%,$<).LZ.bin $(patsubst %.main,%,$<).TZ
/bin/rm -fv $(patsubst %.main,%,$<).TZ
/bin/mv -fv $(patsubst %.main,%,$<).TR $(patsubst %.main,%,$<).LR.bin
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment