3 ms·
interesting. good pattern. I frequently do something similar: opt=" # this is the foo option a=1 # define the bar #BAR=ON #BAR=OFF BAR=MAYBE
by m463 6y ago
interesting. good pattern. I frequently do something similar:
opt="
# this is the foo option
a=1
# define the bar
#BAR=ON
#BAR=OFF
BAR=MAYBE
" | egrep -v '^#|^$' | sed 's/^/-D/'
or
progs="
one two three
#four five siz
seven ate tree
" | egrep -v '^#|^$' | while read o1 o2 o3
do
program $o1 $o2 $o3
done
sort of like on-the-fly readable configurability