#!/bin/sh for s in $1/lpic* do if [ -d "$s" ] then for t in $s/* do if [ "`basename "$t" ".lpi"`.lpi" = "`basename "$t"`" ] || [ "`basename "$t" ".lpi"`.lpi" = "`basename "$t"`" ] then dir=$(basename "$(grep "path" "$t" | awk '{ print $3 }')") if [ -d "../$dir" ] then dir="../$dir" else if [ -d "../daten_alt/$dir" ] then dir="../daten_alt/$dir" else continue fi fi if [ -d "$dir/Post" ] && [ ! -e "$dir/Post/`basename "$t"`" ] then cp "$t" "$dir/Post/" fi fi done fi done