Bug 193055: the "cat ${file} | while read ...do ... done" construct does NSS_3_2_BRANCH
authorbishakhabanerjee%netscape.com
Fri, 14 Mar 2003 20:44:54 +0000
branchNSS_3_2_BRANCH
changeset 4263 7f7970fc12763a054e717a282bbd0c19b06c904b
parent 1942 b7ddbc6938140fceb13207e189d1ece86ae2eb19
push idunknown
push userunknown
push dateunknown
bugs193055
Bug 193055: the "cat ${file} | while read ...do ... done" construct does not work under MKS Korn shell on Windows XP. Replaced it by the equivalent construct "while read ... do ... done < ${file}"
security/nss/tests/ssl/ssl.sh
--- a/security/nss/tests/ssl/ssl.sh
+++ b/security/nss/tests/ssl/ssl.sh
@@ -178,17 +178,17 @@ start_selfserv()
 ssl_cov()
 {
   html_head "SSL Cipher Coverage"
 
   testname=""
   sparam="-c ABCDEFabcdefghijklm"
   start_selfserv # Launch the server
                
-  cat ${SSLCOV} | while read tls param testname
+  while read tls param testname
   do
       if [ $tls != "#" ]; then
           echo "$SCRIPTNAME: running $testname ----------------------------"
           TLS_FLAG=-T
           if [ $tls = "TLS" ]; then
               TLS_FLAG=""
           fi
           sparam=""
@@ -198,30 +198,30 @@ ssl_cov()
 
           is_selfserv_alive
           echo "tstclnt -p ${PORT} -h ${HOST} -c ${param} ${TLS_FLAG} \\"
           echo "        -f -d . < ${REQUEST_FILE}"
           tstclnt -p ${PORT} -h ${HOST} -c ${param} ${TLS_FLAG} -f \
                   -d . < ${REQUEST_FILE}
           html_msg $? 0 "${testname}"
       fi
-  done
+  done < ${SSLCOV}
 
   kill_selfserv
   html "</TABLE><BR>"
 }
 
 ############################## ssl_auth ################################
 # local shell function to perform SSL  Client Authentication tests
 ########################################################################
 ssl_auth()
 {
   html_head "SSL Client Authentication"
 
-  cat ${SSLAUTH} | while read value sparam cparam testname
+  while read value sparam cparam testname
   do
       if [ $value != "#" ]; then
           cparam=`echo $cparam | sed -e 's;_; ;g'`
           start_selfserv
 
           echo "tstclnt -p ${PORT} -h ${HOST} -f -d . ${cparam} \\"
           echo "        < ${REQUEST_FILE}"
           tstclnt -p ${PORT} -h ${HOST} -f -d . ${cparam} < ${REQUEST_FILE}
@@ -234,45 +234,45 @@ ssl_auth()
               echo "             $value (no error as tmp workaround)"
               value=$ret
           fi
 
           html_msg $ret $value "${testname}" \
                    "produced a returncode of $ret, expected is $value"
           kill_selfserv
       fi
-  done
+  done < ${SSLAUTH}
 
   html "</TABLE><BR>"
 }
 
 
 ############################## ssl_stress ##############################
 # local shell function to perform SSL stress test
 ########################################################################
 ssl_stress()
 {
   html_head "SSL Stress Test"
 
-  cat ${SSLSTRESS} | while read value sparam cparam testname
+  while read value sparam cparam testname
   do
       if [ $value != "#" ]; then
           cparam=`echo $cparam | sed -e 's;_; ;g'`
           start_selfserv
 
           echo "strsclnt -p ${PORT} -d . -w nss $cparam $verbose \\"
           echo "         ${HOSTADDR}"
           echo "strsclnt started at `date`"
           strsclnt -p ${PORT} -d . -w nss $cparam $verbose ${HOSTADDR}
           echo "strsclnt completed at `date`"
 
           html_msg $? $value "${testname}"
           kill_selfserv
       fi
-  done
+  done < ${SSLSTRESS}
 
   html "</TABLE><BR>"
 }
 
 
 ############################## ssl_cleanup #############################
 # local shell function to finish this script (no exit since it might be
 # sourced)