Mailing-List: contact cygwin-help@cygwin.com; run by ezmlm List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner@cygwin.com Mail-Followup-To: cygwin@cygwin.com Delivered-To: mailing list cygwin@cygwin.com Message-ID: From: Mark Sheppard To: "'dontspam@gmx.net'" , cygwin@cygwin.com Subject: RE: sed does not work as expected Date: Mon, 16 Sep 2002 15:12:44 +0100 MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" [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@gmx.net [mailto:dontspam@gmx.net] Sent: 16 September 2002 14:59 To: cygwin@cygwin.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/