Can I pass filename to script called in shell?

Terry Duell tduell at iinet.net.au
Fri Feb 20 16:13:49 CST 2009


On Fri, 20 Feb 2009 23:45:36 +1100, Francesco Potorti`  
<Potorti at isti.cnr.it> wrote:

>> I have a script file (run-psd.m), as follows...
>>
>> 	file = read(argv(){2});
>> 	acc = dlmread(file);
>> 	psd = autspec(acc,dt,win,raw);
>> 	save -ascii psddata psd
>
> What is "read"?  I suppose you meant
>
>  file = argv(){2};

That has fixed the problem.
I had searched for info on how to do this and found a posting (not sure if  
it was in this group archive) that suggested the 'file = read(argv(){1});'  
syntax and the response at the time was that it worked...so that is what I  
had been trying.

>  acc = dlmread(file);
>  psd = autspec(acc,dt,win,raw);
>  save -ascii psddata psd

> But then, what is "autspec" and "psddata"?

Well, 'autspec' is a local function that I have written, and 'psddata' is  
the file that resulting data is written to.

I had spend some time trying to sort this proble, so many thanks for your  
advice.

Cheers,
-- 
Regards,
Terry Duell


More information about the Help-octave mailing list