#!/bin/bash for x in $(find $1 -name "*.pot"); do qcv_file=$(echo $x | sed -e "s%\/en-GB\/%/qcv/%g;s%^en_pot%qcv_po%g;s%pot$%po%g") if [ ! -e "$qcv_file" ]; then dir_name="$(dirname $qcv_file)" mkdir -p "$dir_name" cp "$x" "$qcv_file" else msgmerge -U "$qcv_file" "$x" fi done