On Sun, 3 Jul 2005 12:14:05 -0400
"fbsd_user" <[EMAIL PROTECTED]> wrote:

> Thanks but I need a little more help.
> 
> num_ip="(printf $raw_ip | sed 's/\.//g')"
> 
> gives me a error.
> 
> What would the correct syntax be?
> 
> I am trying to write script to insert rules into PF firewall 
> on 5.4. using pf anchors.
> 

Hello,

The problem here is that

num_ip="(printf $raw_ip | sed 's/\.//g')"

makes num_ip equal to

(printf $raw_ip | sed 's/\.//g')

instead of its output.

To assign the output of a command use "`":

num_ip=`(printf $raw_ip | sed 's/\.//g')`

Also the subshell (the "()") is not needed:

num_ip=`printf $raw_ip | sed 's/\.//g'`

Hope that helps.

Best Regards,
Ale
_______________________________________________
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to "[EMAIL PROTECTED]"

Reply via email to