#!/bin/bash exec ddccontrol.cs_raw.po END=false # Preamble: while read -r ; do case $REPLY in "#, fuzzy" )break;; * ) echo "$REPLY";; esac done echo while read -r ; do case $REPLY in "" )break;; * ) echo "$REPLY";; esac done while read -u3 -r ; do case $REPLY in "" )break;; esac done echo read # Body: while : ; do case $REPLY in msgstr* );; "" ) while read -r -u3 ; do case $REPLY in "#"* );; # msgstr* );; "msgstr \"\"" );; "" ) break;; * ) OUT="${REPLY/msgid/msgstr}" OUT="${OUT// \\ n/\\n}" OUT="${OUT// \\ N/\\n}" OUT="${OUT//\\ n/\\n}" OUT="${OUT//\\ N/\\n}" OUT="${OUT// \\ t/\\t}" OUT="${OUT// \\ T/\\t}" OUT="${OUT//\\ t/\\t}" OUT="${OUT//\\ T/\\\\t}" OUT="${OUT//%%/---PERCENT---}" OUT="${OUT//% / %}" OUT="${OUT//( %/(%}" OUT="${OUT//' %/'%}" OUT="${OUT//---PERCENT---/%%}" OUT="${OUT%\"}\"" echo "$OUT";; esac done echo;; * ) echo "$REPLY";; esac if $END ; then break ; fi if ! read -r ; then END=true REPLY= ; fi done exec >&- msgmerge ddccontrol.cs_raw.po ddccontrol.pot >ddccontrol.cs.po