Script Preprocessor
Hello
Currently im thinking about a way to handel our init scripts.
In some Scripts we have some ugly code like
##########fw_printenv device >/tmp/device
. /tmp/device
if [ "$device" = "X" ]
then
echo This is device X
fi
if [ "$device" = "X" -o "$device" = "Y"]
then
echo This is device X or Y
fi
##########
This is not the way it should be.
This could be resolved on build time.
Did anybody know a solution?
I could write a Script which could preprocess a file like this. A line begins with"#X" meens if [ "$device" = "X" ] then ..... fi
##########fw_printenv device >/tmp/device
. /tmp/device
#X echo This is device X
#X||Y echo This is device X or Y
##########
Maybe there is already a solution?
Best regards
Patrick Fischer