From owner-freebsd-questions@FreeBSD.ORG Fri Jun 15 12:23:36 2007 Return-Path: X-Original-To: freebsd-questions@freebsd.org Delivered-To: freebsd-questions@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id E994C16A400 for ; Fri, 15 Jun 2007 12:23:36 +0000 (UTC) (envelope-from oregnier@oregnier.net) Received: from 30.mail-out.ovh.net (30.mail-out.ovh.net [213.186.62.213]) by mx1.freebsd.org (Postfix) with SMTP id 64F8713C43E for ; Fri, 15 Jun 2007 12:23:36 +0000 (UTC) (envelope-from oregnier@oregnier.net) Received: (qmail 21097 invoked by uid 503); 15 Jun 2007 12:23:55 -0000 Received: (QMFILT: 1.0); 15 Jun 2007 12:23:55 -0000 Received: from unknown (HELO mail183.ha.ovh.net) (213.186.33.59) by 30.mail-out.ovh.net with SMTP; 15 Jun 2007 12:23:55 -0000 Received: from b0.ovh.net (HELO queue-out) (213.186.33.50) by b0.ovh.net with SMTP; 15 Jun 2007 12:23:32 -0000 Received: from mac76-2-82-241-6-173.fbx.proxad.net (HELO ?127.0.0.1?) (postmaster@oregnier.net@82.241.6.173) by ns0.ovh.net with SMTP; 15 Jun 2007 12:23:32 -0000 Message-ID: <467284F9.7090005@oregnier.net> Date: Fri, 15 Jun 2007 14:24:25 +0200 From: Olivier Regnier User-Agent: Thunderbird 2.0.0.0 (Windows/20070326) MIME-Version: 1.0 To: Nikos Vassiliadis References: <467269EE.6090001@oregnier.net> <200706151404.47348.nvass@teledomenet.gr> In-Reply-To: <200706151404.47348.nvass@teledomenet.gr> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 8bit X-Ovh-Remote: 82.241.6.173 (mac76-2-82-241-6-173.fbx.proxad.net) X-Ovh-Local: 213.186.33.20 (ns0.ovh.net) X-Spam-Check: DONE|H 0.5/N Cc: freebsd-questions@freebsd.org Subject: Re: problem with sed command and csh X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 15 Jun 2007 12:23:37 -0000 Nikos Vassiliadis a écrit : > On Friday 15 June 2007 13:29, Olivier Regnier wrote: > >> Hi everybody, >> >> Actually, i'm working on FreeBSD 6.2 and csh shell. With a sh script, i >> trying to execute this command : >> sed -e "s/MAKE_ARGS\([^{]*\){/MAKE_ARGS\1{\n\t'mail/nbsmtp' => >> 'WITH_IPV6=1 WITH_SSL=1',/" > /usr/local/etc/pkgtools.conf >> >> The result is not correct, i have an error : >> sed: 1: "s/MAKE_ARGS\([^{]*\){/M . . .": bad flag in subsitute command: >> 'n' >> >> Can you help me please ? >> > > s/MAKE_ARGS\([^{]*\){/MAKE_ARGS\1{\n\t'mail/nbsmtp' => > This n is invalid--------------------------^^^ > > You should add a backslash before each slash > that is not used as a separator for the s command. > E.g. > s/I want to substitute the \/ character/with the _ character/ > s/\/\/\//three slashes/ > > You can also use a separator of choice for the s command. > That is: > s/foo/bar/ is equivalent to s@foo@bar@ > is equivalent to sAfooAbarA > is equivalent to s1foo1bar1. > > keep in mind, that our sed might not be > totally compatible with GNU sed. > > HTH, Nikos > Thank for you anserw but the result is bad again :) I tryed this : sed "s/MAKE_ARGS\([^{]*\){/MAKE_ARGS\1{\n\t'mail\/nbsmtp' => 'WITH_IPV6=1 WITH_SSL=1',/" > /usr/local/etc/pkgtools.conf but i have this with cat /usr/local/etc/pkgtools.conf MAKE_ARGS = {nt'mail/nbsmtp' => 'WITH_IPV6=1 WITH_SSL=1', } Sed and csh is strange no ? I think \n \t not supported by csh.