I am new to awk and am having, what I think maybe a syntax problem.
Trying to add a row of numbers my command line is this:
echo '4 3 6 7'|awk '{count=$1} {for(length();count1=count;(total=(count++))<=NF) print "total is " total }'
two things I cannot figure out, how to define '{count=$1}' to represent each field, and I am trying to stop the 'for' loop when <=NF is reached.
Trying to add a row of numbers my command line is this:
echo '4 3 6 7'|awk '{count=$1} {for(length();count1=count;(total=(count++))<=NF) print "total is " total }'
two things I cannot figure out, how to define '{count=$1}' to represent each field, and I am trying to stop the 'for' loop when <=NF is reached.