Re: IDL batchfile as a linux script? [message #58707] |
Tue, 12 February 2008 07:27 |
Mike[2]
Messages: 99 Registered: December 2005
|
Member |
|
|
On Feb 12, 12:25 am, eyuc...@gmail.com wrote:
> Another way to put my question is: Is there anyway to pass variables
> between IDL and Linux shell?
You can use GETENV and SETENV to get and set environment variables.
Mike
|
|
|
Re: IDL batchfile as a linux script? [message #58712 is a reply to message #58707] |
Tue, 12 February 2008 02:28  |
lasse
Messages: 48 Registered: February 2007
|
Member |
|
|
On 12 Feb, 06:25, eyuc...@gmail.com wrote:
> Hello everyone,
>
> I am probably trying to use IDL batch files in a strange way.
> What I am trying to do is as follows:
> 1. I have a bunch of files 1.txt, 2.txt, ..., 500.txt in a folder.
> 2. I will make some calculation, and get a result i, which is an
> integer, that ranges from 1 to 500.
> 3. Depending on the result, I will move the file whose name coincides
> with i to another folder.
>
> Basically, I want to put a line similar to "$mv string(i)+'.txt' ../
> anotherfolder/string(i)+'.txt'" in my IDL batchfile. Of course, that
> won't work for obvious reason...
>
> Another way to put my question is: Is there anyway to pass variables
> between IDL and Linux shell?
For a more general approach, I guess EXECUTE is your friend. You can
assemble a command from all sorts of variables (converted to string)
and then execute that. Or SPAWN, for that matter. Have a look at the
documentation for more details.
So long
Lasse Clausen
|
|
|
Re: IDL batchfile as a linux script? [message #58714 is a reply to message #58712] |
Mon, 11 February 2008 21:58  |
David Fanning
Messages: 11724 Registered: August 2001
|
Senior Member |
|
|
eyuchen@gmail.com writes:
> Another way to put my question is: Is there anyway to pass variables
> between IDL and Linux shell?
Have you tried FILE_MOVE?
Cheers,
David
--
David Fanning, Ph.D.
Fanning Software Consulting, Inc.
Coyote's Guide to IDL Programming (www.dfanning.com)
Sepore ma de ni thui. ("Perhaps thou speakest truth.")
|
|
|