Assuming you typed it in correctly (as putting all on the cmd line is difficult) I see no real issues.
I placed it in a script as follows:
Code:
#!/bin/bash
cat Edit3 | tr -d "\r" | while read LINE
do
echo "$LINE" | grep -q '>\.\.'
if [ $? -eq 0 ]
then
LOGFILE=$(echo $LINE | cut -d' ' -f1).log
else
echo "$LINE" >> $LOGFILE
fi
done
Just made it a little easier to read. This did manage to create the 3 log files (if there really is a single quote before IPTR then that will also be the name of the file).
One gotcha I could see is that if the log should have an entry prior to a log file name (ie HLR >..) then the variable LOGFILE will have no value.
The f1.log error, my only guess here is that you used a quote instead of a back tick.
I believe the second error is just a flow on of the first so once it is solved the second should also disappear.
Hope that helps.