0

I have a piped unix script which finally yields a line number to me in the subject file.
Now,I need to print out the file contents from this particular line to the end.
Is it possible to feed the line number to sed via xargs,for sed to print out the desired.

.....|tail -1 | cut -f 1 | xargs sed ...?

Is this possible?

IUnknown
  • 9,301
  • 15
  • 50
  • 76
  • There's probably a way to do this, but are you sure it wouldn't be easier to enclose the whole thing in backticks? sed -n "`.....|tail -1 | cut -f 1`p" filename – Beta Nov 12 '13 at 06:42
  • @Beta Backtics should not be use, use parentheses `$(code)` http://stackoverflow.com/questions/4708549/shell-programming-whats-the-difference-between-command-and-command – Jotne Nov 12 '13 at 06:57

1 Answers1

0
..... | tail -1 | cut -f 1 | xargs -i sed -n '{},$p' your_file
pobrelkey
  • 5,853
  • 20
  • 29