Yes it was a typo
I was too tired to be posting on forums that day!
The condensed script using the iteration works perfectly and is great.
I realised today that the problem I was having with my long winded method of trying to do this, was actually to do with something else, but I am glad I asked anyway as I prefer the condensed method and will in future use that for similar functions.
I was going on file size to check if the files had joined successfully. The files were much bigger than they should have been hence I thought it was a problem in this cat function....the file size was though due to a sed command prior to the cat...although my code to cat was pretty bad considering the new code i have now been given.
I was doing this search/replace...
Code:
sed -i 's/\|HeadingOne\|/\|HeadingTwo\|/g' $SLHD3
I was searching for a string containing a pipe, thinking that escaping the pipe with the backslash would be ok, but that was causing some weirdness, making the files huge, leading me to think that the cat command was joining files multiple times.
Anyway that part of the problem has was fixed by using double quotes round the sed command and no escape character for the pipe.
Code:
sed -i "s/|HeadingOne|/|HeadingTwo|/g" $SLHD3
Thankyou