#!/bin/bash sum=0 for i in `cat nowcoder.txt | awk 'BEGIN{getline}{print $4}'` do sum=`echo "$sum + $i" | bc` done echo $sum