From: Pranav_ on 7 May 2010 01:22 declare -a timevect timelist=`cat "$LOGFILE"` timevect=($timelist) sumt=0 for cnt in ${timevect[@]:0} do sumt=$(echo "scale=12; $sumt+$cnt" | bc) done while calculating the sum of all integers in the LOGFILE I am getting (standard_in) 1: parse error (standard_in) 1: parse error (standard_in) 1: parse error (standard_in) 1: parse error (standard_in) 1: parse error I am not getting why I am getting this error exactly, Some times it works fine, but many times I get above mentioned error. Can anyone please help me?
From: Janis Papanagnou on 7 May 2010 04:02 Pranav_ schrieb: > declare -a timevect > timelist=`cat "$LOGFILE"` > timevect=($timelist) > > sumt=0 > for cnt in ${timevect[@]:0} > do > sumt=$(echo "scale=12; $sumt+$cnt" | bc) > done > > while calculating the sum of all integers in the LOGFILE I am getting > (standard_in) 1: parse error > (standard_in) 1: parse error > (standard_in) 1: parse error > (standard_in) 1: parse error > (standard_in) 1: parse error > > I am not getting why I am getting this error exactly, Some times it > works fine, but many times I get above mentioned error. Can anyone > please help me? Add set -x as the first command in your script and see what is displayed. Janis
|
Pages: 1 Prev: tar/pkunzip question between two machine Next: Purge file keep some backup copy |