procmail
[Top] [All Lists]

Re: hex value in condition

1997-08-10 04:05:00
era eriksson <era(_at_)iki(_dot_)fi> wrote:

era> On Sun, 10 Aug 1997 07:38:23 +0900,
era> Mitsuru Furukawa <furu(_at_)009(_dot_)com> wrote:
era>  > BTW, could you teach me what this sed script is supposed to do?
era>  > | sed -e 's+^- -+-+' \
era>  > I browsed sed man page but could not find any clue.
era> 
era> It will translate "- -" at beginning of line to "-". 

So, + in sed corresponds to / in perl???
Isn't + used for r+ expression which matches to r once or more?
I tried to use /^_+ \xca\xd6\xbf\xae _+$/ instead of
/^_* \xca\xd6\xbf\xae _*$/ in sed but never matched.
So I changed to /^__* \xca\xd6\xbf\xae __*$/ to make it safer.

era> 
era>  era> :0fbw
era>  era> | perl -pe 'last if /^_* \xca\xd6\xbf\xae _*$/'
era>  > I think I go with
era>  > | perl -ne 'print unless /^_* \xca\xd6\xbf\xae _*$/..eof'
era> 
era> The "last" is more efficient because it will bail out immediately
era> instead of continue to read lines up until eof. 

OK. Thanks.

_/_/_/      Mitsuru FURUKAWA      _/_/_/
_/_/_/        Tokyo, Japan        _/_/_/
_/_/_/     mailto:furu(_at_)009(_dot_)com    _/_/_/
_/_/_/  http://www.009.com/furu/  _/_/_/

<Prev in Thread] Current Thread [Next in Thread>