kde-workspace/kioslave/fish/generate_fishcode.sh
2015-08-28 05:29:36 +03:00

13 lines
338 B
Bash
Executable file

#!/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