Guys,
I need your advice. I am attempting to print 1-n lines and then n-z lines.
If i enter in number it works fine e.g output lines 1 - 10 and 11 - 20, then it works fine.. But it fails when i pass string, as it outputs all the lines and not what i am asking for.
Environment Variable substitution does not work between single quote characters. Your sed statements are in single quote characters. Try double quote characters.
Also in the sed statments I think that you need a single space character before the p .
Your original code is written as if each record in the input file starts with a field containing the line number. If this is not so, then your sed commands need attention.