This is the mail archive of the
mailing list for the Cygwin project.
Cygwin's vanilla sed : capabilities and limitations
- From: <fergus at bonhard dot uklinux dot net>
- To: <cygwin at cygwin dot com>
- Cc: <fergus at bonhard dot uklinux dot net>
- Date: Wed, 16 Jul 2003 13:59:36 +0100
- Subject: Cygwin's vanilla sed : capabilities and limitations
- Reply-to: <fergus at bonhard dot uklinux dot net>
This is probably a cheat question (non-central Cygwin issue) but it is about
Cygwin's vanilla sed.
AND it is only asked in order eventually to provide anybody interested with
the elegant-est possible script for making a portable Cygwin CD.
Q1. Querying info sed reveals the expression matcher to be "greedy",
matching the longest possible string. Is there a way to make it match the
shortest possible, so that echo aaabbbccc | sed 's/^.*b//' (altered but
similar) grabs aaab not aaabbb?
Q2. Is there a way using the supplied sed without major enhancements to
change "abc x def" to "def x abc": that is, to grab two distinct portions
and swap them (using $1,$2 or \1,\2 or whatever).
Sorry for asking: I know it's a sin: hope the end articulated above
justifies the means.
Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple
Problem reports: http://cygwin.com/problems.html