#!/bin/bash for x in $(find $1 -name "*.pot"); do ca_es_file=$(echo $x | sed -e "s%\/en-GB\/%/ca-ES/%g;s%^en_pot%ca-es_po%g;s%pot$%po%g") if [ ! -e "$ca_es_file" ]; then dir_name="$(dirname $ca_es_file)" mkdir -p "$dir_name" cp "$x" "$ca_es_file" echo "copiando el fichero $ca_es_file" else msgmerge -U "$ca_es_file" "$x" mv "${ca_es_file}~" "$ca_es_file" echo "moviendo $ca_es_file" fi done