Usage of seq, echo, tail, awk, sort, cat for data analysys
for i in `seq 0 1 8`
do
cd ${i}/magmom
for j in `seq 0 1 70`
do
echo ${j} `tail -1 OSZICAR_${j}` >> res
done
awk '{print $1, $4}' res >> res.out
sort -k 2 res.out | tail -1 >> min_${i}
cat min_${i} >> ../../mins; cd ../..
done
Thanks,
JF
do
cd ${i}/magmom
for j in `seq 0 1 70`
do
echo ${j} `tail -1 OSZICAR_${j}` >> res
done
awk '{print $1, $4}' res >> res.out
sort -k 2 res.out | tail -1 >> min_${i}
cat min_${i} >> ../../mins; cd ../..
done
Thanks,
JF
댓글
댓글 쓰기