[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[ale] expect script question
- Subject: [ale] expect script question
- From: fletch at phydeaux.org (Fletch)
- Date: 24 Aug 2001 10:30:33 -0400
>>>>> "Yong" == Yong Wang <yongwang at mindspring.com> writes:
Yong> Thanks to all who responded to my email. To escape +, it
Yong> take "\\+", which is a bit surprising. This is not the
Yong> regular expression I am used to. In sed, this can be done:
Yong> echo "+OK 0 0" | sed -e 's/\+OK \([0-9]*\)
Yong> \([0-9]*\)/\1:\2/'
It's the same regular expressions, it's a different quoting
mechanism. You've got to double the \ inside the ""'s to get the
backslash itself into the string. "\+" is simply `+'. The same thing
would happen in the shell if you used double quotes there rather than
single quotes.
--
Fletch | "If you find my answers frightening, __`'/|
fletch at phydeaux.org | Vincent, you should cease askin' \ o.O'
770 933-0600 x211(w) | scary questions." -- Jules =(___)=
| U
--
To unsubscribe: mail majordomo at ale.org with "unsubscribe ale" in message body.