bash is great but sh is standard - and think optimal, dude
[xorg/xkeyboard-config] / rules / merge.sh
1 #!/bin/sh
2
3 DEST=$1
4 shift
5
6 > $DEST
7
8 for i in $*; do
9   if [ "$i" == "HDR" ] ; then
10     echo >> $DEST;
11     read hdr
12     echo "$hdr" >> $DEST
13   else
14     cat $i >> $DEST;
15   fi
16 done < HDR
17