Many command-line tools (grep
, flex
, etc.) use the ^
symbol to denote "beginning of line" and the $
symbol to denote "end of line." When did this convention arise? It seems perfectly reasonable to reserve two characters for these purposes, but it's a bit odd that on modern keyboards the $
symbol is to the left of the ^
symbol.
Is this a completely arbitrary decision? Does this come from some older keyboard layout? Is this convention used because some older tool decided to do things this way?
Regardless of the answer, are there primary sources that document this?
glob
, makes a lot of sense. Perhaps I'm mistaken, though, but doesglob
actually support^
and$
? – templatetypedef Apr 05 '19 at 17:40^
and$
are regular expression tokens (here), which is why I added that tag. – Jeff Schaller Apr 05 '19 at 17:43