iproute2mac icon indicating copy to clipboard operation
iproute2mac copied to clipboard

Oneline output '-o' support

Open floatingatoll opened this issue 7 years ago • 4 comments

While trying to repair ddclient on OS X (cc @dkerr64), I found that the command ddclient uses:

$reply = `ip -6 -o addr show dev $arg scope global 2>/dev/null`;

Is incompatible with your Linux-compat wrapper due to the '-o' argument. I looked and I think you're already implementing -o by default:

       -o, -oneline
              output each record on a single line, replacing line feeds with the '\' character. This is convenient when you want
              to count records with wc(1) or to grep(1) the output.

So it might be as simple as just ignoring -o when passed.

floatingatoll avatar Jun 14 '17 19:06 floatingatoll

Thanks for the report, ignoring -o seems like viable fix. Will be implemented in the next version.

brona avatar Jun 04 '18 18:06 brona

@brona Hi, I can't see any commit for the -o ignoring, has it been implemented yet ?

sebma avatar Nov 14 '20 08:11 sebma

Not yet, so far it is a FR, if you send a PR I will review it.

brona avatar Nov 18 '20 16:11 brona

So just ignoring the option, is not good enough, actually for ip link and ip addr it changes the output considerably and especially for use-case where counting lines matters it is important.

brona avatar Mar 21 '22 01:03 brona