https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=226406

            Bug ID: 226406
           Summary: sysrc(8) wrong output when value is "-n"
           Product: Base System
           Version: 11.1-RELEASE
          Hardware: Any
                OS: Any
            Status: New
          Severity: Affects Only Me
          Priority: ---
         Component: bin
          Assignee: freebsd-bugs@FreeBSD.org
          Reporter: mariu...@lden.org

Created attachment 191264
  --> https://bugs.freebsd.org/bugzilla/attachment.cgi?id=191264&action=edit
sysrc.patch

When the value of a variable is set to "-n" it will be printed as an empty
value.

Example output when setting a variable to be "-n":

% sysrc -f rc.conf  xyz=-n
xyz: test ->
% sysrc -f rc.conf  xyz
xyz:
% sysrc -f rc.conf -c xyz=-n ; echo $?
1
% grep xyz= rc.conf
xyz="-n"

Desired output:

% sysrc -f rc.conf xyz=-n
xyz: test -> -n
% sysrc -f rc.conf xyz
xyz: -n
% sysrc -f rc.conf -c xyz=-n ; echo $?
0

The attached patch fixed this for me.

-- 
You are receiving this mail because:
You are the assignee for the bug.
_______________________________________________
freebsd-bugs@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/freebsd-bugs
To unsubscribe, send any mail to "freebsd-bugs-unsubscr...@freebsd.org"

Reply via email to