scripting for menu

Hi,

I'm writting a script to filter a cvs log and get only the modified files to move them to a specific directory to compile.

I try to filter a line and move from source to target, with no results. Could you help me?

for example, in the cvs log file appears:
cat log.txt
U project/FOLDER1/FOLDER2/org/com/package/date/file.java
P project/FOLDER1/FOLDER2/properties/file.properties

And I'd like an ouput file like this:
cat solution.txt
cp -Rfp project/FOLDER1/FOLDER2/org/com/package/date/file.java temp/classes/
cp -Rfp project/FOLDER1/FOLDER2/properties/file.properties /temp/properties/

any idea?

I thought about join 2 filtered files, but when try to do a "cat -b" only join from 1 to 9 lines.

I have somethink like that:

echo "Step 1: Sorting only 'P' , 'C' and 'U' lines from cvs export"
sorting.sh $1
echo "Step 2: Cutting 2 first chars to get line"
if [[ -r 1.temp ]]; then
{
cut -f5- -d \/ 1.temp > 2.temp
cut -b3- 1.temp > 2b.temp
cat -b 2.temp > 2d.temp
cat -b 2b.temp > 2e.temp
join 2e.temp 2d.temp > 2c.temp
#cut -b2- 2c.temp > prepare.temp
echo "Step 3: Substitute the string for deployment structure"
#filters.sh prepare.temp
echo "Applying modes and executing ..."
#sort filtered.temp | uniq > exec.temp
#chmod +x exec.temp
#exec.temp
echo "Removing temp files"
#rm *.temp
};
fi
echo "Done!"

Thanks in advance,

try this one ... (you might need to add another \ to the "$2" on the awk line) ...

#!/bin/ksh
for TYPE in U P
do
    awk "/^${TYPE}/ {print \$2}" cvs.log > ${TYPE}.tmp
    if [ -s ${TYPE}.tmp ]
    then
          case ${TYPE} in
          U) TMPDIR=/temp/classes ;;
          P) TMPDIR=/temp/properties ;;
          esac
          for FILE in `< ${TYPE}.tmp`
          do
               cp -Rfp ${FILE} ${TMPDIR}
          done
     else
          echo "${TYPE} not found in cvs.log"
     fi
done

exit 0

nawk -f manu.awk log.txt | sh

here's manu.awk:

$1 == "U" { dst = "temp/classes"}
$1 == "P" { dst = "/temp/properties"}
$1 == "P" || $1 == "U" { printf("cp -Rfp %s %s\n", $2, dst) }