From owner-freebsd-questions@FreeBSD.ORG Wed Dec 12 09:15:19 2007 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D4CAB16A421 for ; Wed, 12 Dec 2007 09:15:19 +0000 (UTC) (envelope-from maslak@ihlas.net.tr) Received: from pop3.ihlas.net.tr (smtp.ihlas.net.tr [213.238.128.249]) by mx1.freebsd.org (Postfix) with SMTP id F30FC13C465 for ; Wed, 12 Dec 2007 09:15:18 +0000 (UTC) (envelope-from maslak@ihlas.net.tr) Received: (qmail 4141 invoked by uid 89); 12 Dec 2007 09:15:26 -0000 X-Mail-Scanner: Scanned by qSheff-II-2.1 (http://www.enderunix.org/qsheff/) Received: from unknown (HELO ihlasnetym) (213.238.150.220) by 0 with SMTP; 12 Dec 2007 09:15:25 -0000 Message-ID: <003601c83c9f$7f229aa0$dc96eed5@ihlasnetym> From: "Halid Faith" To: References: <001001c83c33$669b46b0$dc96eed5@ihlasnetym> <20071211234633.GA3568@basement.net> Date: Wed, 12 Dec 2007 11:15:10 +0200 MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 6.00.2800.1807 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1896 Subject: Re: How to replace two strings in a file in the same time withsed command ? 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: Wed, 12 Dec 2007 09:15:19 -0000 I tried it, but I get an error; cut: boby, e, 656a, No such file or directory cut: boby, e, 656a, No such file or directory cut: allen, e, 987c, No such file or directory cut: allen, e, 987c, No such file or directory ... here's my script for i in `cat file1` ; do sed -e "s/old1/new1 `cut -d, -f 1 ${file1}/g" -e "s/old2/`cut -d, -f 3 ${file1}`/g" file2 > file3 done when I run myscript I get an error as above. -d option of cut command could not run.