Note that the ^ around $user are outside the quotes, and in the Plan 9
rc shell that makes them concatenation operators, so they are actually
concatenating $user into the string being passed to grep, and are not
part of the regular expression itself.
On 9/12/26 10:41, [email protected] wrote:
Still trying to figure out how to be both precise and concise and
searchable with my topics.
Two more to come shortly, that are much more important.
Page 217 contains the following, near the bottom:
; grep -s '^[^:]+:'^$user^':' /adm/users && echo $user exists
I think I understand it pretty well, except for the ^'s around $user.
I tried removing them,
but suspect that that just produced a different command that happened
to have the same output.
The best I can come up with now is that the instruction searches for a
line that starts with one or more of anything that isn't :, followed
by : ... and that the ^ before $user means that $user appears
immediately after the last matched :, as if the first string that got
matched has now been cut-off of the rest of the string, so that ^
refers to the beginning of the -rest- of the string. And that the
same logic applies to the ^ before ':'. That logic seems a bit crazy
to me, but -would- explain that expression.
*9fans <https://9fans.topicbox.com/latest>* / 9fans / see discussions
<https://9fans.topicbox.com/groups/9fans> + participants
<https://9fans.topicbox.com/groups/9fans/members> + delivery options
<https://9fans.topicbox.com/groups/9fans/subscription> Permalink
<https://9fans.topicbox.com/groups/9fans/Tc4b53f9fc2b1c71a-M5546e67ec9d8cc08d31fb916>
------------------------------------------
9fans: 9fans
Permalink:
https://9fans.topicbox.com/groups/9fans/Tc4b53f9fc2b1c71a-M0d704b4b1b7cb1299eda6505
Delivery options: https://9fans.topicbox.com/groups/9fans/subscription