On 03/22/2017 03:39 PM, Julian H. Stacey wrote:
>
> cd /usr/local/mailman/lists
> config_list -o - bg | egrep -v '^[[:space:]]*#|^$' # OK, but not ideal
> config_list -o - bg | egrep -v '^[[:space:]]*#|$' # Empty.
Because '^[[:space:]]*#|$' matches '^[[:space:]]*#' or '$' i.e.
everything with an end of line
> config_list -o - bg | egrep -v '^[[:space:]]*[#$]' # Blank lines remain.
Because [#$] is a character class matching literally '3' or '$' not end
of line.
> config_list -o - bg | egrep -v '^[[:space:]]*[#$]|^$' # OK
> config_list -o - bg | egrep -v '^[[:space:]]{0,}[#$]' # Blank lines remain.
>
As above.
> Does some other Unix have a better worded or more verbose RE definition,
You don't need to be concerned about leading whitespace because
config_list -o doesn't write comments with lkeading whitespace.
config_list -o - bg | egrep -v '^(#|$)'
which matches and ignores any line that starts with # or is empty. This
is similar to your '^[[:space:]]*#|^$' example without the unneeded
[[:space:]]* except it says 'beginning of the line followed by either #
or end of line' instead of 'beginning of line followed by # or begining
of line followed by end of line'
--
Mark Sapiro <[email protected]> The highway is for gamblers,
San Francisco Bay Area, California better use your sense - B. Dylan
------------------------------------------------------
Mailman-Users mailing list [email protected]
https://mail.python.org/mailman/listinfo/mailman-users
Mailman FAQ: http://wiki.list.org/x/AgA3
Security Policy: http://wiki.list.org/x/QIA9
Searchable Archives: http://www.mail-archive.com/mailman-users%40python.org/
Unsubscribe:
https://mail.python.org/mailman/options/mailman-users/archive%40jab.org