"ipset -quiet list [set_name]" should not output.
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
ipset (Ubuntu) |
Won't Fix
|
Undecided
|
Unassigned |
Bug Description
(ubuntu) ~ lsb_release -rd
Description: Ubuntu 12.04.2 LTS
Release: 12.04
(ubuntu) ~ apt-cache policy ipset
ipset:
Installed: 6.11-2
Candidate: 6.11-2
Version table:
*** 6.11-2 0
500 http://
100 /var/lib/
The ipset man page indicates the '-quiet' option should "suppress any output to stdout and stderr".
But,
root@ubuntu:~# ipset -quiet list
Name: my-list
Type: hash:ip
Header: family inet hashsize 1024 maxelem 65536
Size in memory: 8276
References: 0
Members:
This makes scripts inconsistent/ugly because 'list' must redirect stdout/err, while '-quiet' works with other commands.
Example,
if ipset list my_list > /dev/null 2>&1 ; then # Because "ipset -quiet list mylist" is not quiet.
ipset -quiet flush my_list
fi
I see what you are saying, and this behaviour persists to the current release (artful).
However by using the 'list' operator, your kinda always going to get some output as that's the action requested.
I'm going to mark this as a Won't Fix for Ubuntu as I'd not want to change behaviour of ipset for Ubuntu alone; if you feel this should be changed, or maybe a new operator be introduced to check for the existence of a set then please report a bug to the upstream project (https:/ /bugzilla. netfilter. org/).