lilalo
changeset 158:d775ffd49dbf tip
minifix: bsd/darwin in uname
author | Igor Chubin <igor@chub.in> |
---|---|
date | Wed Feb 01 17:14:54 2012 +0200 (2012-02-01) |
parents | 137cf5a580be |
children | |
files | install l3bashrc |
line diff
1.1 --- a/install Mon Nov 28 13:26:46 2011 +0200 1.2 +++ b/install Wed Feb 01 17:14:54 2012 +0200 1.3 @@ -1,7 +1,7 @@ 1.4 #!/bin/sh 1.5 1.6 hostname=`hostname` 1.7 -uname -a | grep -qi freebsd || hostname=`hostname -f` 1.8 +uname -a | egrep -qi '(freebsd|darwin)' || hostname=`hostname -f` 1.9 1.10 ############################################################################### 1.11 # 1.12 @@ -30,7 +30,7 @@ 1.13 apt_get_install_this="perl make libmodule-build-perl libc6-dev gcc" 1.14 1.15 wget=wget 1.16 -uname -a | grep -qi bsd && wget=fetch 1.17 +uname -a | egrep -qi '(bsd|darwin)' && wget=fetch 1.18 1.19 normC='\033[0;39m' 1.20 whiteC='\033[1;37m' 1.21 @@ -79,7 +79,7 @@ 1.22 1.23 get_user_home() 1.24 { 1.25 - uname -a | grep -qi freebsd && pw user show "$@"| awk -F: '{print $9}' || getent passwd "$@"| awk -F: '{print $6}' 1.26 + uname -a | egrep -qi '(freebsd|darwin)' && pw user show "$@"| awk -F: '{print $9}' || getent passwd "$@"| awk -F: '{print $6}' 1.27 } 1.28 1.29 install_to_users_homes()
2.1 --- a/l3bashrc Mon Nov 28 13:26:46 2011 +0200 2.2 +++ b/l3bashrc Wed Feb 01 17:14:54 2012 +0200 2.3 @@ -44,7 +44,7 @@ 2.4 # and del vvvv this if it does 2.5 2.6 export L3_TTY=`/usr/bin/tty` 2.7 - uname -a | grep -qi bsd && bsd=yes 2.8 + uname -a | egrep -qi '(bsd|darwin)' && bsd=yes 2.9 proc_on_the_term=`w | grep "${L3_TTY##/dev/}" | awk '{print $8;}'` 2.10 # freeBSD: 2.11 [ -n "$bsd" ] && \ 2.12 @@ -60,7 +60,7 @@ 2.13 mkdir -p $L3_HOME 2.14 2.15 tty=`/usr/bin/tty` 2.16 - uname -a | grep -qi bsd && bsd=yes 2.17 + uname -a | egrep -qi '(bsd|darwin)' && bsd=yes 2.18 parent=`cat /proc/$PPID/cmdline 2> /dev/null` 2.19 [ -z "$parent" ] && parent="`ps waux | awk '{if ($2 == '$PPID') print $11; }'`" 2.20 system=`uname -rs` 2.21 @@ -92,7 +92,7 @@ 2.22 2.23 _l3_run_script() 2.24 { 2.25 - uname -a | grep -qi bsd && bsd=yes 2.26 + uname -a | egrep -qi '(bsd|darwin)' && bsd=yes 2.27 flush="-f" #linux 2.28 [ -n "$bsd" ] && flush="-t 0" #freebsd 2.29 export L3_PARENT_TTY=`/usr/bin/tty`