Display file from line # to end of file
I know how to display contents at the end of beginning of a file or even at specific lines but how to you display a file from line # to the end of the file?
Thanks & Regards, |
Code:
#!/bin/bash |
Thanks.
I just found out this appears to work also: Code:
sed -n 'line#,$p' file Update: Hmmm. This doesnt work in a bash script as $p gets expanded and errors out. Tried double quotes but no go. :-( |
Quote:
|
Thanks grail but I am using a variable for the line number which is causing me the issue.
Code:
sed -n '$LINES,$p' file |
Well that changes things, so like whenever you don't want special stuff to happen, just escape it:
Code:
sed -n "$LINE,\$p" file |
All times are GMT -5. The time now is 10:36 PM. |