#!/bin/bash sicnt=`grep 'ions per' $1/OUTCAR | awk '{ print $5 }'` ccnt=`grep 'ions per' $1/OUTCAR | awk '{ print $6 }'` ((total=sicnt+ccnt)) echo "parsing OUTCAR file ..." echo " Si: $sicnt, C: $ccnt, total: $total" cnt=0 tcnt=0 energy=`grep energy\ without $1/OUTCAR | tail -1 | awk '{ print $8 }'` echo " total energy: $energy eV" echo "$energy $total" | \ awk '{ print " cohesive energy: "$1/$2 " eV" }' echo