[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Sheflug] SuSE : Spaces in a log-prefix?



> On Thu, 2005-07-07 at 10:41 +0100, lesleyb wrote:
> > Hello
> > 
> > I can't seem to get this minor problem sorted out.
> > 
> > Using the variable :
> > 
> > $LOG_PR1="LAB_TEST_IN "
> > 
> > with a filter rule with this action
> > 
> > -j LOG --log-prefix $LOG_PR1

This looks like iptables :-) But its not an iptables problem, its a shell
problem (but not really a problem - the shell is doing exactly the right
thing). Try using:

	--log-prefix "$LOG_PR1"

i.e., put quotes round $LOG_PR1 in the call as well as in your env var
assignment. If you don't put the quotes round, the spaces get gobbled
up by the shell when its parsing the command line. If you expand it out
its the difference between:

	... -j LOG --log-prefix LAB_TEST_IN  --example-option

and

	... -j LOG --log-prefix "LAB_TEST_IN " --example-option

Chris...

-- 
\ Chris Johnson           \
 \ cej [at] nightwolf.org.uk    ~-----,   
  \ http://cej.nightwolf.org.uk/  ~-----------------------------------, 
   \ Redclaw chat - http://redclaw.org.uk - telnet redclaw.org.uk 2000 \____
___________________________________________________________________

Sheffield Linux User's Group -
http://www.sheflug.co.uk/mailfaq.html

  GNU the choice of a complete generation.