I have a bash script to automate plotting using gnuplot, however the load command within gnuplot does not work in the bash script. The command simply gets stuck.
Here is my bash script:
#!/bin/bash
for k in _1 +1 _2 +2 _3 +3 _4 +4 _5 +5 _6 +6
do
cd $k/surface
for i in s ss
do
cd $i
for j in `ls -d */`
do
if [ "$j" != "unrelax/" ]; then
cd $j/spin
echo $k$i$j
gnuplot
load 't-dos.plt'
exit
cd ../../
fi
done
cd ..
done
cd ../../
done
t-dos.plt contains:
cat > t-dos.plt << eof
fermi=$(head -6 DOSCAR | tail -1 | awk '{print $4}')
plot 't-dos' u (\$1-fermi):2 w l
replot 't-dos' u (\$1-fermi):3 w l
set term post enhanced color
set output 't-dos.ps'
rep
eof
My output is like:
entering the gnuplot and stay there forever
gnuplot t-dos.pltin the middle.