Commit 1faeca7f authored by thomas.forbriger's avatar thomas.forbriger
Browse files

[WP] (issue14): lisousi/examples: replace echo by printf

On this branch issue14 will be resolved:

do not rely on /bin/bash
------------------------

Parts of the project rely on /bin/bash being the standard shell and /bin/sh
being a synonym for /bin/bash.

 *  This is the case in shell scripts, which use bash-specific commands and
    keywords.
 *  This is the case in Makefiles, which use constructs like 'echo -e' to
    format multiline string output.

The problem can be solved by:

 *  replacing '#!/bin/sh' by '#!/bin/bash' in shell scripts
 *  replacing 'echo -e' by 'printf' in Makefiles
parent 8d7894a6
......@@ -13,30 +13,30 @@
#----------------------------------------------------------------------
# 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 +45,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 -----
......@@ -39,7 +39,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 +48,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 +56,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 +74,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 +84,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 +95,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 +105,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 +119,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 +129,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 +142,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 +152,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