Quote:
Originally Posted by
kristinu
That's correct. I am just doing echo to check the commands created are correct so
when I happy with how things are set up, I can then invoke them properly.
---------- Post updated at 05:12 PM ---------- Previous update was at 04:24 PM ----------
Should I do `cd` to the directory so that I can run `mseed2sac`? I am not following
very well how to use `find $pwd`
First, I suggested using
find $PWD ...; not
find $pwd .... Your shell sets
PWD to an absolute pathname of your current working directory when it starts up and updates it every time you successfully execute a
cd command. (When you successfully execute
cd, your shell also sets
OLDPWD to an absolute pathname of the directory you were in before you executed
cd.)
There is no reason to think that the value assigned to the variable
pwd will have any value assigned to it unless your script does that. And
$pwd will not be updated by your shell when you execute
cd!
Your code does the following:
- read a relative pathname of an input file to be processed from /tmp/wrk,
- runs mseed2sac,
- calculates the directory where the output file(s) should be located,
- create that directory (if it doesn't already exist), and
- move the output file(s) to that directory.
My suggestion is to change that to:
- read an absolute pathname of an input file to be processed from /tmp/wrk,
- calculate the directory where the output file(s) should be located,
- create that directory (if it doesn't already exist),
- cd to that directory, and
- run mseed2sac.
Note that no
mv is included in the above suggestion.