I am trying to create a user prompt when reading a file line by line in Bash. The idea is that I can split the various files one by one using Gnuplot. Here is what I have:
#!/bin/bash echo "Enter filename that contains the filenames:" read fname xr="[1e8:1e20]" yr="[1:1e13]" while read line do echo -e "reset\nset log\nset xrange$xr\nset yrange$yr\nset xlabel \"Frequency [Hz]\"\nset ylabel \"F_{/Symbol n} [Jy Hz]\"\nset key top left\nplot \"$line.dat\" u 3:(\$3*\$4)*1e26 wl ti \"$line^o\" \n"> plt.gp gnuplot plt.gp done < $fname
I would like to enter user input / "continue?" before the gnuplot plt.gp command, because at the moment it just quickly unwraps everything and then exits. The standard -p read command does not work here. I read somewhere that I might need to use the file descriptor descriptor descriptor 5 command, but I don't understand. Thanks.
source share