git: 778120ce8df6 - main - sysrc: Change -l/-L to list files one per-line
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Wed, 25 Nov 2026 21:51:28 UTC
The branch main has been updated by dteske:
URL: https://cgit.FreeBSD.org/src/commit/?id=778120ce8df6d1c60f336bdb49b0f6d64b82b33f
commit 778120ce8df6d1c60f336bdb49b0f6d64b82b33f
Author: Devin Teske <dteske@FreeBSD.org>
AuthorDate: 2026-11-25 21:46:19 +0000
Commit: Devin Teske <dteske@FreeBSD.org>
CommitDate: 2026-11-25 21:47:37 +0000
sysrc: Change -l/-L to list files one per-line
This makes -l and -L consistent with sysconf target -l/-L such that:
sysconf rc -l # or -L (in turn calls sysrc -l or -L)
sysconf lo -l # or -L (lo valid short-hand for loader)
similarly produce one file per-line. This is instead of the former
behavior where sysrc -l/-L (and thus sysconf rc -l/-L) produced one
long line with each path separated my a single space.
Reviewed by: kfv
Differential Revision: https://reviews.freebsd.org/D61739
---
usr.sbin/sysrc/sysrc | 27 ++++++++++++++-------------
1 file changed, 14 insertions(+), 13 deletions(-)
diff --git a/usr.sbin/sysrc/sysrc b/usr.sbin/sysrc/sysrc
index d0d5b55847f8..c5bb85be3be1 100644
--- a/usr.sbin/sysrc/sysrc
+++ b/usr.sbin/sysrc/sysrc
@@ -16,7 +16,7 @@ pgm="${0##*/}" # Program basename
#
# Version information
#
-SYSRC_VERSION="8.8 Nov-18,2026"
+SYSRC_VERSION="8.9 Nov-18,2026"
#
# Options
@@ -328,9 +328,10 @@ if [ "$LIST_SERVICE_CONFS" ]; then
[ -e "$file" -a ! -d "$file" ] || continue
fi
case "$list" in
- "$file"|*" $file"|"$file "*|*" $file "*) continue ;;
+ *" $file "*|*" $file") continue ;;
esac
list="$list $file"
+ [ "$VERBOSE$SHOW_EQUALS" ] || echo "$file"
done
list="${list# }"
if [ $# -eq 0 ]; then
@@ -354,8 +355,7 @@ if [ "$LIST_SERVICE_CONFS" ]; then
fi
if [ ! "$VERBOSE" -a ! "$SHOW_EQUALS" ]; then
case "$list" in
- "$file"|*" $file"|"$file "*|*" $file "*)
- continue ;;
+ *" $file "*|*" $file") continue ;;
esac
fi
slist="$slist $file"
@@ -370,15 +370,13 @@ if [ "$LIST_SERVICE_CONFS" ]; then
elif [ "$SHOW_EQUALS" ]; then
[ "$slist" ] && shell_fmt "$service=%s\n" "$slist"
continue
+ elif [ $# -eq 0 -o ! "$QUIET" ]; then
+ for item in $slist; do
+ echo "$item"
+ done
fi
list="$list${slist:+ }$slist"
done
- if [ ! "$VERBOSE" -a ! "$SHOW_EQUALS" ]; then
- if [ $# -eq 0 -o ! "$QUIET" ]; then
- list="${list# }"
- [ "$list" ] && echo $list
- fi
- fi
exit $retval
fi
@@ -438,12 +436,15 @@ fi
if [ "$LIST_CONFS" ]; then
[ $# -eq 0 ] || usage "-l does not take names" # NOTREACHED
if [ "$DEFAULT" ]; then
- echo "$RC_DEFAULTS"
+ list="$RC_DEFAULTS"
elif [ "${RC_CONFS+set}" ]; then
- echo "$RC_CONFS"
+ list="$RC_CONFS"
else
- f_sysrc_get rc_conf_files
+ list=$( f_sysrc_get rc_conf_files )
fi
+ for item in $list; do
+ echo "$item"
+ done
exit $SUCCESS
fi