delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2003/07/16/09:00:41

Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Subscribe: <mailto:cygwin-subscribe AT cygwin DOT com>
List-Archive: <http://sources.redhat.com/ml/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-help AT cygwin DOT com>, <http://sources.redhat.com/ml/#faqs>
Sender: cygwin-owner AT cygwin DOT com
Mail-Followup-To: cygwin AT cygwin DOT com
Delivered-To: mailing list cygwin AT cygwin DOT com
Message-ID: <000701c34b9a$1c7e6c80$6fc82486@medschool.dundee.ac.uk>
Reply-To: <fergus AT bonhard DOT uklinux DOT net>
From: <fergus AT bonhard DOT uklinux DOT net>
To: <cygwin AT cygwin DOT com>
Cc: <fergus AT bonhard DOT uklinux DOT net>
Subject: Cygwin's vanilla sed : capabilities and limitations
Date: Wed, 16 Jul 2003 13:59:36 +0100
MIME-Version: 1.0
X-Priority: 3
X-MSMail-Priority: Normal
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165

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.

Fergus


--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Problem reports:       http://cygwin.com/problems.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019