Hacker News new | ask | show | jobs
by gp2000 3312 days ago
In command contexts "." refers to the current line (e.g., :.,$s/a/b/ will perform the a -> b substitution from the current line to the last line of the file). That comes from ex which likely copied that from ed. I've seen "." used similarly in other contexts. 8-bit Microsoft BASIC used "." for the current line -- "LIST ." would list the last line that had been listed or edited. A number of assemblers use "." for the current assembly address.

The point being that there is a bit of a tradition of using "." for "the current thing" so there's a sort of sense in using it for the most recent command.

If you're really curious get in touch with Bill Joy.

1 comments

Also ./ for the current folder is still used on all OS's. I think your examples predate computers having folders though.
UNIX's ‘.’ predates Microsoft BASIC. (Possibly inherited from Multics, but I don't know.)
I was thinking more of ed, for some reason I thought folders were a later invention, 70's or early 80's, but they were first used in 1958: https://en.wikipedia.org/wiki/Directory_(computing)