OSSP CVS Repository

ossp - Difference in ossp-pkg/shtool/sh.echo versions 1.35 and 1.36
Not logged in
[Honeypot]  [Browse]  [Home]  [Login]  [Reports
[Search]  [Ticket]  [Timeline
  [History

ossp-pkg/shtool/sh.echo 1.35 -> 1.36

--- sh.echo      2003/02/22 12:27:20     1.35
+++ sh.echo      2003/08/13 14:20:34     1.36
@@ -51,7 +51,7 @@
 #   determine terminal bold sequence
 term_bold=''
 term_norm=''
-if [ ".$opt_e" = .yes -a ".`echo $text | egrep '%[Bb]'`" != . ]; then
+if [ ".$opt_e" = .yes ] && [ ".`echo $text | grep '%[Bb]'`" != . ]; then
     case $TERM in
         #   for the most important terminal types we directly know the sequences
         xterm|xterm*|vt220|vt220*)
@@ -87,13 +87,13 @@
                         break
                     fi
                 done
-                if [ ".$term_bold" != . -a ".$term_norm" != . ]; then
+                if [ ".$term_bold" != . ] && [ ".$term_norm" != . ]; then
                     break;
                 fi
             done
             ;;
     esac
-    if [ ".$term_bold" = . -o ".$term_norm" = . ]; then
+    if [ ".$term_bold" = . ] || [ ".$term_norm" = . ]; then
         echo "$msgprefix:Warning: unable to determine terminal sequence for bold mode" 1>&2
         term_bold=''
         term_norm=''
@@ -102,7 +102,7 @@
 
 #   determine user name
 username=''
-if [ ".$opt_e" = .yes -a ".`echo $text | egrep '%[uUgG]'`" != . ]; then
+if [ ".$opt_e" = .yes ] && [ ".`echo $text | grep '%[uUgG]'`" != . ]; then
     username="`(id -un) 2>/dev/null`"
     if [ ".$username" = . ]; then
         str="`(id) 2>/dev/null`"
@@ -131,7 +131,7 @@
 
 #   determine user id
 userid=''
-if [ ".$opt_e" = .yes -a ".`echo $text | egrep '%U'`" != . ]; then
+if [ ".$opt_e" = .yes ] && [ ".`echo $text | grep '%U'`" != . ]; then
     userid="`(id -u) 2>/dev/null`"
     if [ ".$userid" = . ]; then
         userid="`(id -u ${username}) 2>/dev/null`"
@@ -144,11 +144,11 @@
                 userid=`(getent passwd ${username}) 2>/dev/null | \
                         sed -e 's/[^:]*:[^:]*://' -e 's/:.*$//'`
                 if [ ".$userid" = . ]; then
-                    userid=`egrep "^${username}:" /etc/passwd 2>/dev/null | \
+                    userid=`grep "^${username}:" /etc/passwd 2>/dev/null | \
                             sed -e 's/[^:]*:[^:]*://' -e 's/:.*$//'`
                     if [ ".$userid" = . ]; then
                         userid=`(ypcat passwd) 2>/dev/null |
-                                egrep "^${username}:" | \
+                                grep "^${username}:" | \
                                 sed -e 's/[^:]*:[^:]*://' -e 's/:.*$//'`
                         if [ ".$userid" = . ]; then
                             userid='?'
@@ -162,7 +162,7 @@
 
 #   determine (primary) group id
 groupid=''
-if [ ".$opt_e" = .yes -a ".`echo $text | egrep '%[gG]'`" != . ]; then
+if [ ".$opt_e" = .yes ] && [ ".`echo $text | grep '%[gG]'`" != . ]; then
     groupid="`(id -g ${username}) 2>/dev/null`"
     if [ ".$groupid" = . ]; then
         str="`(id) 2>/dev/null`"
@@ -173,10 +173,10 @@
             groupid=`(getent passwd ${username}) 2>/dev/null | \
                      sed -e 's/[^:]*:[^:]*:[^:]*://' -e 's/:.*$//'`
             if [ ".$groupid" = . ]; then
-                groupid=`egrep "^${username}:" /etc/passwd 2>/dev/null | \
+                groupid=`grep "^${username}:" /etc/passwd 2>/dev/null | \
                          sed -e 's/[^:]*:[^:]*:[^:]*://' -e 's/:.*$//'`
                 if [ ".$groupid" = . ]; then
-                    groupid=`(ypcat passwd) 2>/dev/null | egrep "^${username}:" | \
+                    groupid=`(ypcat passwd) 2>/dev/null | grep "^${username}:" | \
                              sed -e 's/[^:]*:[^:]*:[^:]*://' -e 's/:.*$//'`
                     if [ ".$groupid" = . ]; then
                         groupid='?'
@@ -189,7 +189,7 @@
 
 #   determine (primary) group name
 groupname=''
-if [ ".$opt_e" = .yes -a ".`echo $text | egrep '%g'`" != . ]; then
+if [ ".$opt_e" = .yes ] && [ ".`echo $text | grep '%g'`" != . ]; then
     groupname="`(id -gn ${username}) 2>/dev/null`"
     if [ ".$groupname" = . ]; then
         str="`(id) 2>/dev/null`"
@@ -198,14 +198,14 @@
         fi
         if [ ".$groupname" = . ]; then
             groupname=`(getent group) 2>/dev/null | \
-                       egrep "^[^:]*:[^:]*:${groupid}:" | \
+                       grep "^[^:]*:[^:]*:${groupid}:" | \
                        sed -e 's/:.*$//'`
             if [ ".$groupname" = . ]; then
-                groupname=`egrep "^[^:]*:[^:]*:${groupid}:" /etc/group 2>/dev/null | \
+                groupname=`grep "^[^:]*:[^:]*:${groupid}:" /etc/group 2>/dev/null | \
                            sed -e 's/:.*$//'`
                 if [ ".$groupname" = . ]; then
                     groupname=`(ypcat group) 2>/dev/null | \
-                               egrep "^[^:]*:[^:]*:${groupid}:" | \
+                               grep "^[^:]*:[^:]*:${groupid}:" | \
                                sed -e 's/:.*$//'`
                     if [ ".$groupname" = . ]; then
                         groupname='?'
@@ -219,7 +219,7 @@
 #   determine host and domain name
 hostname=''
 domainname=''
-if [ ".$opt_e" = .yes -a ".`echo $text | egrep '%h'`" != . ]; then
+if [ ".$opt_e" = .yes ] && [ ".`echo $text | grep '%h'`" != . ]; then
     hostname="`(uname -n) 2>/dev/null |\
                awk '{ printf("%s", $1); }'`"
     if [ ".$hostname" = . ]; then
@@ -236,16 +236,16 @@
             ;;
     esac
 fi
-if [ ".$opt_e" = .yes -a ".`echo $text | egrep '%d'`" != . ]; then
+if [ ".$opt_e" = .yes ] && [ ".`echo $text | grep '%d'`" != . ]; then
     if [ ".$domainname" = . ]; then
         if [ -f /etc/resolv.conf ]; then
-            domainname="`egrep '^[      ]*domain' /etc/resolv.conf | sed -e 'q' |\
+            domainname="`grep '^[       ]*domain' /etc/resolv.conf | sed -e 'q' |\
                          sed -e 's/.*domain//' \
                              -e 's/^[   ]*//' -e 's/^ *//' -e 's/^      *//' \
                              -e 's/^\.//' -e 's/^/./' |\
                          awk '{ printf("%s", $1); }'`"
             if [ ".$domainname" = . ]; then
-                domainname="`egrep '^[  ]*search' /etc/resolv.conf | sed -e 'q' |\
+                domainname="`grep '^[   ]*search' /etc/resolv.conf | sed -e 'q' |\
                              sed -e 's/.*search//' \
                                  -e 's/^[       ]*//' -e 's/^ *//' -e 's/^      *//' \
                                  -e 's/ .*//' -e 's/    .*//' \
@@ -261,7 +261,7 @@
 time_month=''
 time_year=''
 time_monthname=''
-if [ ".$opt_e" = .yes -a ".`echo $text | egrep '%[DMYm]'`" != . ]; then
+if [ ".$opt_e" = .yes ] && [ ".`echo $text | grep '%[DMYm]'`" != . ]; then
     time_day=`date '+%d'`
     time_month=`date '+%m'`
     time_year=`date '+%Y' 2>/dev/null`

CVSTrac 2.0.1