Ok. I'm kinda stumped here, maybe someone knows...

I made this file because ? seems to work oddly in sed.
--begin--
#matchme
matchme
#?matchme
--end--
if I do:

sed -n 's/^#?matchme$/&/p'  or
egrep '^#\?matchme$' or
gawk -F'\n' '{if ($1 ~ /^#\?matchme$/) print;}'

I get
#?matchme

but if I do
sed -n 's/^#\?matchme$/&/p' or
egrep '^#?matchme' or
gawk -F'\n' '{if ($1 ~ /^#?matchme$/) print;}'

I get
#matchme
matchme

I read the egrep man page and egrep and awk works how it claims.
The sed man page is pretty worthless, so I turned to the info docs,
and the sed info regex section says look at the awk info page, which
claims that regular expressions should work just like egrep.

I'm inclined to report it as a bug in sed, but I want to check that I'm
not being stupid first.

(sorry if this is the wrong place to ask, but if I'm being dumb, I'll take 
a lot less abuse for it here than on comp.lang.sed :-) )
oh
(GNU awk 3.04, GNU sed 3.02, GNU grep 2.4)

thanks,

greg
-- 
this is not here

-
To unsubscribe from this list: send the line "unsubscribe linux-newbie" in
the body of a message to [EMAIL PROTECTED]
Please read the FAQ at http://www.linux-learn.org/faqs

Reply via email to