Hi.
I'm trying to little bash script to help me automate the conversion of files between two seismic format.
The code that does the conversion exists already and is called
codeco3. With my set-up I simply call it from the command line (> codeco3) and interact with it as follows to do the conversion:
codeco3 : enter name of file to be converted
me : name.format_A
codeco3 : enter input file format
me : format_A
codeco3 : enter name for output file
me : name.format_b
codeco3 : enter output file format
me : format.b
But I have a zillion files to be converted and would like to automate the process, and I have not written a script based around an interactive program before...so I'm a bit stuck.
Basically I want the script to read all files in a directory, and pass these all to codeco3 one at a time for conversion - but do not know how to pass them to codeco3 one at a time within a script...
Code:
#!/usr/bin/bash
# script to convert SHM outputted miniseed files
# to SAC format.
list=$(ls)
for file in $list
do
**** codeco3 ??? ****
done