kde-workspace/kioslave/fish/generate_fishcode.sh

14 lines
339 B
Bash
Raw Normal View History

2014-11-15 04:16:00 +02:00
#!/bin/sh
# $1 is fish.pl
# $2 is md5sum
# $3 is the output file
# $4 are the parameters for cut
SUM=`$2 "$1" | cut -d ' ' $4 `
echo '#define CHECKSUM "'$SUM'"' > $3
echo 'static const char *fishCode(' >> $3
sed -e 's/\\/\\\\/g;s/"/\\"/g;s/^[ ]*/"/;/^"# /d;s/[ ]*$/\\n"/;/^"\\n"$/d;s/{CHECKSUM}/'$SUM'/;' "$1" >> $3
echo ');' >> $3