sh-2.02$ cat simple Here is a file containing some words. A total of 3 lines have been used. This line makes the last one right. sh-2.02$ c=3 sh-2.02$ sed -n /A/,"$c"p simple A total of 3 lines have been used. This line makes the last one right. sh-2.02$ expr $c + 4 7 sh-2.02$ c=`wc -l simple` sh-2.02$ echo $c 3 simple sh-2.02$ expr $c + 4 expr: syntax error sh-2.02$ sed -n /A/,"$c"p simple