From owner-freebsd-hackers@FreeBSD.ORG Mon Jul 7 01:32:00 2003 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 1894737B401 for ; Mon, 7 Jul 2003 01:32:00 -0700 (PDT) Received: from prioris.mini.pw.edu.pl (prioris.mini.pw.edu.pl [194.29.178.2]) by mx1.FreeBSD.org (Postfix) with ESMTP id 6A5B943FAF for ; Mon, 7 Jul 2003 01:31:59 -0700 (PDT) (envelope-from P.Dawidek@prioris.mini.pw.edu.pl) Received: from localhost (localhost.mini.pw.edu.pl [127.0.0.1]) by prioris.mini.pw.edu.pl (Postfix) with ESMTP id 5D58924396; Mon, 7 Jul 2003 10:31:55 +0200 (CEST) Received: by prioris.mini.pw.edu.pl (Postfix, from userid 1091) id AC74F2438D; Mon, 7 Jul 2003 10:31:49 +0200 (CEST) Date: Mon, 7 Jul 2003 10:31:49 +0200 From: Pawel Jakub Dawidek To: Luigi Rizzo Message-ID: <20030707083149.GC2199@prioris.mini.pw.edu.pl> References: <20030707004626.B56037@xorpc.icir.org> Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-2 Content-Disposition: inline In-Reply-To: <20030707004626.B56037@xorpc.icir.org> User-Agent: Mutt/1.4.1i X-PGP-Key-URL: http://garage.freebsd.pl/jules.pgp X-OS: FreeBSD 4.8-STABLE i386 X-Virus-Scanned: by AMaViS (prioris) cc: hackers@freebsd.org Subject: Re: hints on shell string expansion ? X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 07 Jul 2003 08:32:00 -0000 On Mon, Jul 07, 2003 at 12:46:26AM -0700, Luigi Rizzo wrote: +> I am writing a script to generate ipfw test cases, and as +> part of the script i need to generate 'actions' which can be either +> one or more, e.g. [...] +> actions="allow 'deny log' 'pipe 10'" +> for act in $actions ; do +> echo "add $act ip from 1.2.3.4 to 5.6.7.8" +> done +> +> I have tried to play tricks with quotes and backquotes, backslashes, +> eval, etc. but no methods helped. Any ideas ? Maybe just: IFS='#' actions="allow#deny log#pipe 10" for act in $actions; do echo "add $act ip from 1.2.3.4 to 5.6.7.8" done -- Pawel Jakub Dawidek pawel@dawidek.net UNIX Systems Programmer/Administrator http://garage.freebsd.pl Am I Evil? Yes, I Am! http://cerber.sourceforge.net