Is there a way to refer to a specific line number in a file as part of the pathname, or some way to package a link to a line number, which looks/behaves like a pathname? For example, giving the string above to another user of the same filesystem so that they can easily open my file "fname" and instantly be on line 1242 therein.
I'm thinking of behavior similar to HTML anchors, which can be included inline with the URI to a page, and then behave just like links. Namely, they can be given to other users of the same filesystem and will indicate a given line in the file to those users, opening the file by default to that line. I realize that in UNIX the only things that can truly be part of a pathname may be directories, files and pseudo-files. But then there are globs, string expansion, etc., which are not strictly part of a pathname but can be interposed in one "comfortably", while the filename is passed around and referenced, without entailing any additional commands. Is there an inline way to simulate anchor/link behavior like this for a UNIX file?
I could include command substitution in my "pathname" with
sed "1242p" and some kind of self-reference, but then I'm no longer dealing with a pathname, just a command operating on a file. Come to think of it, then I would not be linking, just extracting a line. I can't think of a way to link to a specific line at all (without ignoring the rest of the file).
GNU bash, version 3.2.51