]> git.nbdom.net Git - nb.git/commitdiff
etc/profile.d/sys.sh
authorNicolas Boisselier <nicolas.boisselier@gmail.com>
Sun, 17 Feb 2019 21:40:10 +0000 (21:40 +0000)
committerNicolas Boisselier <nicolas.boisselier@gmail.com>
Sun, 17 Feb 2019 21:40:10 +0000 (21:40 +0000)
etc/profile.d/sys.sh

index e5837484b34a4f189da5beb82f58a6cc011efb29..30ad9b4c90bc9e4f80fa5caeb0c0069e8bf23a2c 100644 (file)
@@ -3,6 +3,17 @@
 # NB 10.12.16   #*) return ;;
 # NB 10.12.16 esac
 
+sys_watch() {
+       local opt="$@"
+       [ -z "$opt" ] && opt="-d"
+
+       shopt -s expand_aliases;
+       #export -f $(typeset -f | awk '/^[a-z]+[a-zA-Z0-9_]+ \(\)/{print $1}')
+       watch --no-title $opt ". $NB_ROOT/etc/profile.d/sys.sh && sys_activity"
+# NB 08.08.17   export -f sys_activity
+# NB 08.08.17   watch --no-title $opt bash -c "sys_activity"
+}
+
 sys_infos() {
        local s="$(printf '\t')"
        grep -vE "^[^${s}]+${s}$" << EOF
@@ -16,16 +27,6 @@ os${s}$(sys_os)
 EOF
 }
 
-sys_os() {
-       if [ -e /etc/os-release ]; then
-               (
-                       . /etc/os-release && echo $ID $VERSION
-               )
-       fi
-       #[ -r /etc/debian_version ] && echo Debian $(cat /etc/debian_version) && return
-       echo $(sw_vers 2>/dev/null | awk -F':\t' '/^(ProductName|ProductVersion)/{print $2}' | head -2) && return
-}
-
 sys_date_install() {
        (date -r $(ls -1drt /lost+found /etc/ssh/ssh_host_dsa_key.pub /etc/ssh_host_dsa_key.pub|head -1) +'%F %T') 2>/dev/null
 }
@@ -119,14 +120,12 @@ sys_activity() {
        rm -rf "$tmp"*
 }
 
-sys_watch() {
-       local opt="$@"
-       [ -z "$opt" ] && opt="-d"
-
-       shopt -s expand_aliases;
-       #export -f $(typeset -f | awk '/^[a-z]+[a-zA-Z0-9_]+ \(\)/{print $1}')
-       watch --no-title $opt ". $NB_ROOT/etc/profile.d/sys.sh && sys_activity"
-# NB 08.08.17   export -f sys_activity
-# NB 08.08.17   watch --no-title $opt bash -c "sys_activity"
+sys_os() {
+       if [ -e /etc/os-release ]; then
+               (
+                       . /etc/os-release && echo $ID $VERSION
+               )
+       fi
+       #[ -r /etc/debian_version ] && echo Debian $(cat /etc/debian_version) && return
+       echo $(sw_vers 2>/dev/null | awk -F':\t' '/^(ProductName|ProductVersion)/{print $2}' | head -2) && return
 }
-