failure to change directory and execute linux command

Jon <[email protected]>
Newsgroups gmane.comp.graphics.gnuplot.user
Message-ID <CALx0QV6nhFbbgFOjGf2sxPBM8p_EYzMOTwbNzCfiVMCpwUGYPw@mail.gmail.com>
Hi,

I am trying to execute a script ssss.gn within gnuplot 5.2.2 in
linuxmint 18.2 including the following lines
pwdd="`pwd`"
do for [ dir in "4.1 4.15 4.2 4.25 4.3 "] {
  print dir
  cd dir."/right/here/waiting/"
  ef=`head -n 1 DOSCAR | awk '{print $5}'`
  print ef
  cd pwdd
}

but it complains

gnuplot> load "ssss.gn"
head: cannot open 'DOSCAR' for reading: No such file or directory
4.1
         line 5: constant expression required

but the file does exist under the directory, why would it complain
file not existing

Another confusing observation is the error concerning nonexistence of
DOSCAR comes before the print statement in the script. Why is that?

Thanks,

Sincerely,
Jon


_______________________________________________
gnuplot-info mailing list
[email protected]
Membership management via: https://lists.sourceforge.net/lists/listinfo/gnuplot-info
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.