netfilter-devel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Phil Sutter <phil@nwl.cc>
To: imnozi@gmail.com
Cc: Florian Westphal <fw@strlen.de>, netfilter-devel@vger.kernel.org
Subject: Re: iptables 1.8.10 translate error
Date: Sat, 28 Sep 2024 20:39:59 +0200	[thread overview]
Message-ID: <ZvhNf0ZjqFX-41v7@orbyte.nwl.cc> (raw)
In-Reply-To: <20240928082713.3f394112@playground>

On Sat, Sep 28, 2024 at 08:27:13AM -0400, imnozi@gmail.com wrote:
> Ah. Does iptables now auto-insert a space between the prefix and the message? 1.6.0 didn't, which is why I added those spaces years ago.
> 
> But then, how does iptables-translate grouse about the '"' being a bad arg if the shell strips the quotes out?

It's the other way round: You're capturing the quotes in $a so the shell
will pass them to the command after expanding the variable reference.

[...]
> > > [root@kvm64-62 sbin]# iptables-save|grep -- "^-.*LOG" |while read a; do echo -e "\n$a"; iptables-translate $a;done

Your test-script is simply broken. Instead of 'iptables-translate $a',
call 'eval "iptables-translate $a"' and everything's fine. You did not
try calling iptables-translate with given parameters manually, did you?

Please keep in mind that the first step after writing a test script is
to debug the test script itself.

Cheers, Phil

      reply	other threads:[~2024-09-28 18:40 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-09-28  4:12 iptables 1.8.10 translate error imnozi
2024-09-28  8:58 ` Florian Westphal
2024-09-28 12:27   ` imnozi
2024-09-28 18:39     ` Phil Sutter [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=ZvhNf0ZjqFX-41v7@orbyte.nwl.cc \
    --to=phil@nwl.cc \
    --cc=fw@strlen.de \
    --cc=imnozi@gmail.com \
    --cc=netfilter-devel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).