Perl can tell you where you are in the file:
pos=$( perl -le ' open $fh, "<", $ARGV[0]; $/ = "";
In turn, I tried to do a single line
pos=$( perl -00 -lne 'if ($. == 2) {print tell(___what?___); exit}' filename
What is a current file variable? I could not find it in the documents.
source share