| www.delorie.com/archives/browse.cgi | search |
| 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: | <F239CD897B4CD611825600508BE70AC212ADEC@FRUITMACHINE.brighton.climax.co.uk> |
| From: | Mark Sheppard <msheppard AT climax DOT co DOT uk> |
| To: | "'dontspam AT gmx DOT net'" <dontspam AT gmx DOT net>, cygwin AT cygwin DOT com |
| Subject: | RE: sed does not work as expected |
| Date: | Mon, 16 Sep 2002 15:12:44 +0100 |
| MIME-Version: | 1.0 |
[NOTE: this is not a Cygwin specific question and is therefore off topic] The * can match zero or more occurences, so it's matching the "a" and a zero length string. Try this instead: echo ./a/a/a/w | sed -n 's,[^/][^/]*,..,gp' Mark. -----Original Message----- From: dontspam AT gmx DOT net [mailto:dontspam AT gmx DOT net] Sent: 16 September 2002 14:59 To: cygwin AT cygwin DOT com Subject: sed does not work as expected Hi, I would like to transform a string with echo ./a/a/a/w | sed -n '1,$ s/[^\/]*/../gp' I get ..../..../..../..../.. but I expected to get ../../../../.. Can someone tell what's going wrong? Thanks Franz -- GMX - Die Kommunikationsplattform im Internet. http://www.gmx.net -- Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple Bug reporting: http://cygwin.com/bugs.html Documentation: http://cygwin.com/docs.html FAQ: http://cygwin.com/faq/ -- Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple Bug reporting: http://cygwin.com/bugs.html Documentation: http://cygwin.com/docs.html FAQ: http://cygwin.com/faq/
| webmaster | delorie software privacy |
| Copyright © 2019 by DJ Delorie | Updated Jul 2019 |