I have a bash script for reading data and creating images of it. I use a bash script for each file number(100-150) in a for loop to create the images for each of them.
#!/bin/bash
echo "PATH = $PATH";
echo "SHELL = $SHELL";
directory="../run-folders/Gritschneder_et_al_2009/3D_stirMin\=2_stirMax\=20_solWeight\=0.5/Ionization\ Data/dbl_files"
Resolution=100
for i in `seq 100 150`;
do
echo ./surf $directory $i $Resolution $Resolution $Resolution
done
for j in `seq 100 150`;
do
python plotsurfdens.py $directory $j $Resolution
done
rm -rf $directory/*.txt
When I run the script it produces the following message from the executable "surf" where I have checked if the number of arguments is as expected by :-
if(argc!=6) //TO check if no of arguments correct
cout<<"Usage : ./read filedirectory fileno N[X] N[Y] N[Z]"<<endl;
This should not be happening as the number of arguments passed is 6 in the script. Also when I echo the command of running "surf" and copy the printed command,it works. Which means that when I manually type the command I give as a line in a script, it works but not in the script. Why is this happening? Thanks in advance :)
argv[i]in yoursurfto find out!$directory.