Module Name: src Committed By: agc Date: Sat Aug 19 03:06:50 UTC 2017
Modified Files: src/usr.bin/sys_info: sys_info.sh Log Message: + don't assume that tcsh is always installed, pointed out by jmcneill - thanks! + a "sys_info" invocation without any args is now the equivalent of sys_info -a, just like pkg_info To generate a diff of this commit: cvs rdiff -u -r1.1 -r1.2 src/usr.bin/sys_info/sys_info.sh Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
Modified files: Index: src/usr.bin/sys_info/sys_info.sh diff -u src/usr.bin/sys_info/sys_info.sh:1.1 src/usr.bin/sys_info/sys_info.sh:1.2 --- src/usr.bin/sys_info/sys_info.sh:1.1 Sat Jun 4 15:27:11 2016 +++ src/usr.bin/sys_info/sys_info.sh Sat Aug 19 03:06:50 2017 @@ -1,6 +1,6 @@ #! /bin/sh -# $NetBSD: sys_info.sh,v 1.1 2016/06/04 15:27:11 agc Exp $ +# $NetBSD: sys_info.sh,v 1.2 2017/08/19 03:06:50 agc Exp $ # Copyright (c) 2016 Alistair Crooks <a...@netbsd.org> # All rights reserved. @@ -107,7 +107,7 @@ getversion() { sshd -V 2>&1 | awk '/OpenSSH/ { sub("_", "D-", $1); print tolower($1) }' ;; tcsh) - tcsh -c 'echo $version' | awk '{ print $1 "-" $2 }' + grep '/tcsh' /etc/shells > /dev/null 2>&1 && tcsh -c 'echo $version' | awk '{ print $1 "-" $2 }' ;; unbound) case $(uname -s) in @@ -122,7 +122,11 @@ getversion() { esac } -all=false +case $# in +0) all=true ;; +*) all=false ;; +esac + while [ $# -gt 0 ]; do case "$1" in -a) all=true ;;