syntax query

    cat > $file <<OP1 #line 1 
    #some commands
OP1#last line

Hi, i came across the above shell code, but i don't understand the purpose of the first line and and last line,especially the effect of putting a tag( OP1) , can anyone advise me their purpose?

Hi,

U r using here document. For creating here document the start and end sholud be specified by giving uique string. In ur case u r using OP1.

Hi yashavant.a,
thank you.