[hipl-commit] [trunk] Rev 3803: added handling of missing variable and removed append option from perf script

  • From: Rene Hummen <rene.hummen@xxxxxxxxxxxxxxxxx>
  • To: hipl-commit@xxxxxxxxxxxxx
  • Date: Thu, 4 Mar 2010 19:28:47 +0200

Committer: Rene Hummen <rene.hummen@xxxxxxxxxxxxxxxxx>
Date: Thu Mar 04 18:20:34 2010 +0100
Revision: 3803
Revision-id: rene.hummen@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
Branch nick: trunk

Log:
  added handling of missing variable and removed append option from perf script

Modified:
  M  test/performance/perf_measure.sh

=== modified file 'test/performance/perf_measure.sh'
--- test/performance/perf_measure.sh    2010-03-03 17:23:31 +0000
+++ test/performance/perf_measure.sh    2010-03-04 17:20:34 +0000
@@ -16,7 +16,7 @@
 MEASURE_RTT=0
 MEASUREMENT_COUNT=10
 TCP_LENGTH=
-FILE=0
+FILE=
 RTT_POSTFIX=
 TCP_POSTFIX=
 UDP_POSTFIX=
@@ -39,7 +39,7 @@
   exit 0
 fi
 
-set -- `getopt a:b:c:l:n:rst: "$@"`
+set -- `getopt a:b:c:l:n:p:rst: "$@"`
 [ $# -lt 1 ] && exit 1    # getopt failed
 
 while [ $# -gt 0 ]
@@ -51,6 +51,7 @@
         REMOTE_ADDRESS=$2; shift;;
     -l) PACKET_LENGTH=$2; shift;;
     -n) MEASUREMENT_COUNT=$2; shift;;
+    -p) FILE=$2; shift;;
     -r) MEASURE_RTT=1;;
     -s) RUN_MODE=2;;
     -t) MEASURE_TPUT=$2; shift;;
@@ -66,9 +67,9 @@
   TCP_LENGTH="-M "$PACKET_LENGTH
 fi
 
-if [ $FILE -ne "0" ]
+if [ ! $FILE = "" ]
 then
-  OUTPUT="tee --append $FILE"
+  OUTPUT="tee $FILE"
   RTT_POSTFIX="-rtt"
   TCP_POSTFIX="-tcp"
   UDP_POSTFIX="-udp"
@@ -85,10 +86,10 @@
   then
     if [ $ADDR_FAMILY -eq "4" ]
     then
-      ping -c $MEASUREMENT_COUNT $REMOTE_ADDRESS #| $OUTPUT$RTT_POSTFIX
+      ping -c $MEASUREMENT_COUNT $REMOTE_ADDRESS | $OUTPUT$RTT_POSTFIX
     elif [ $ADDR_FAMILY -eq "6" ]
     then
-      ping6 -c $MEASUREMENT_COUNT $REMOTE_ADDRESS #| $OUTPUT$RTT_POSTFIX
+      ping6 -c $MEASUREMENT_COUNT $REMOTE_ADDRESS | $OUTPUT$RTT_POSTFIX
     else
       echo "ERROR: Address family not specified."
       exit 1

Other related posts:

  • » [hipl-commit] [trunk] Rev 3803: added handling of missing variable and removed append option from perf script - Rene Hummen