Author: sparky
Date: Fri Mar  3 01:23:21 2006
New Revision: 7071

Modified:
   ppcrcd/trunk/conf.dir/usr/lib/ppcrcd/functions
Log:
- change [ ] by [[ ]]


Modified: ppcrcd/trunk/conf.dir/usr/lib/ppcrcd/functions
==============================================================================
--- ppcrcd/trunk/conf.dir/usr/lib/ppcrcd/functions      (original)
+++ ppcrcd/trunk/conf.dir/usr/lib/ppcrcd/functions      Fri Mar  3 01:23:21 2006
@@ -14,7 +14,7 @@
 lastlink() {
        ll_dir="$(dirname "$1")"
        ll_file="$(basename "$1")"
-       while [ -n "`resolvesymlink $ll_dir/$ll_file`" ]; do
+       while [[ -n `resolvesymlink $ll_dir/$ll_file` ]]; do
                ll_file="`resolvesymlink $ll_dir/$ll_file`"
                if echo "$ll_file" | egrep -q "^/"; then
                        ll_dir="$(dirname "$ll_file")"
@@ -34,7 +34,7 @@
 die() {
        ERROR=$1
        shift
-       if [ "$ERROR" -gt 0 ]; then
+       if [[ "$ERROR" -gt 0 ]]; then
                echo "$cR${0##*/}: ERROR($ERROR): $*$cE" > /dev/stderr
        else
                ERROR=1
@@ -55,11 +55,11 @@
 ### verbose: display only if verbosity greater than code ($1) ################
 Eopt=
 verbose() {
-       [ -r /verbose ] || return
-       [ "$(< /verbose)" -ge "$1" ] || return
+       [[ -r /verbose ]] || return
+       [[ $(< /verbose) -ge $1 ]] || return
        shift
        Eoptnew=
-       if [ "$1" = "-n" ]; then
+       if [[ $1 = -n ]]; then
                Eoptnew="-n"
                shift
        fi
@@ -77,7 +77,7 @@
                        shift
                        ;;
        esac
-       if [ "$Eopt" = "-n" ]; then
+       if [[ $Eopt = -n ]]; then
                echo $Eoptnew "$color$*$endcol"
        else
                echo $Eoptnew "$color${0##*/}: $*$endcol"
@@ -88,8 +88,8 @@
 
 ### nvvar: display specified or all ppcrcd vars in nvram #####################
 nvvar() {
-       [ -z "$(nvsetenv ppcrcd)" ] && return
-       if [ -n "$1" ]; then
+       [[ -z $(nvsetenv ppcrcd) ]] && return
+       if [[ -n $1 ]]; then
                nvsetenv ppcrcd | sed 's/^ppcrcd=//' | tr "[:blank:]" "\n" | \
                                egrep "^$1=" | sed "s/^[a-zA-Z]*=//"
        else
@@ -100,7 +100,7 @@
 
 ### cmdvar: display specified or all kernel command line vars ################
 cmdvar() {
-       if [ -n "$1" ]; then
+       if [[ -n $1 ]]; then
                cat /proc/cmdline | tr "[:blank:]" "\n" | egrep "^$1=" | \
                                sed "s/^[a-zA-Z]*=//"
        else
@@ -118,7 +118,7 @@
 
 ### tl: to lower #############################################################
 tl() {
-       if [ -n "$1" ]; then
+       if [[ -n $1 ]]; then
                echo $* | tr "[:upper:]" "[:lower:]"
        else
                cat | tr "[:upper:]" "[:lower:]"
_______________________________________________
pld-cvs-commit mailing list
[email protected]
http://lists.pld-linux.org/mailman/listinfo/pld-cvs-commit

Reply via email to