hints on shell string expansion ?

Pawel Jakub Dawidek P.Dawidek at prioris.mini.pw.edu.pl
Mon Jul 7 01:32:00 PDT 2003

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 to"
+> 	done
+> I have tried to play tricks with quotes and backquotes, backslashes,
+> eval, etc. but no methods helped. Any ideas ?

Maybe just:

actions="allow#deny log#pipe 10"
for act in $actions; do
	echo "add $act ip from to"

Pawel Jakub Dawidek                       pawel at dawidek.net
UNIX Systems Programmer/Administrator     http://garage.freebsd.pl
Am I Evil? Yes, I Am!                     http://cerber.sourceforge.net

More information about the freebsd-hackers mailing list