kde-workspace/kioslave/fish/generate_fishcode.sh

14 lines
338 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
2015-08-28 05:29:36 +03:00
# $4 are the parameters for cut
2014-11-15 04:16:00 +02:00
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