A few things...

First, use ELSEIF instead of repeated IF's for something like that. Second, you don't need $calc when getting $lines. Third, you don't need $+ after -dl and before $2. Just -dl $2 is fine.

And I'd suggest some form of error checking. If someone types the command incorrectly, the script won't do anything and he/she will not know why it's not working without some form of error message.

Invision Support
#Invision on irc.irchighway.net