Variation in the position of a particular band w.r.t to Fermi-level (say with pressure etc.)
Here, I have given the example of 39th band (for my case, it is the conduction band) at a particular high-symmetry point (4th k-point according to plotbands.out).
#!/bin/bash
cwd=$(pwd)
for i in ALL_DIRECTORIES # Replace with the dir names
do
cd ${i}
#press=$(echo ${i} | awk '{print $2}' \FS="_") # useful only for my case
at_Gamma_point=$(grep $(grep high-symmetry plotbands.out | head -4 | tail -1 | awk '{print $NF}' ) bands.xmgr | head -39 | tail -1 | awk '{print $2}')
Fermi=$(cat plotbands.in | tail -1 | awk '{print $NF}')
echo $( echo "$at_Gamma_point - $Fermi" | bc -l) >> ${cwd}/variation_of_cond_band_at_G_point.dat
cd ../
done