comp.lang.idl-pvwave archive
Messages from Usenet group comp.lang.idl-pvwave, compiled by Paulo Penteado

Home » Public Forums » archive » Re: Multiple Spawn Commands
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Return to the default flat view Create a new topic Submit Reply
Re: Multiple Spawn Commands [message #49389 is a reply to message #49292] Fri, 14 July 2006 11:27 Go to previous message
Maarten Sneep is currently offline  Maarten Sneep
Messages: 2
Registered: February 2006
Junior Member
In article <1152895388.545979.198960@75g2000cwc.googlegroups.com>,
"Ryan." <rchughes@brutus.uwaterloo.ca> wrote:

> Jo,
> Thank you for your response, that is going to make my life a lot easier
> but i can't seem to get it work properly in a UNIX environment. How do
> you write a foreach loop in a UNIX environment in one line? I have
> experimented a bit with it but it keeps complaining to me about
> misplace brackets, what is the proper syntax?

What is your shell:
spawn, "echo $SHELL"
should tell. Because of the syntax you use in your original post, I
think you're using a csh derivative. It has been a while, but I think
a foreach loop looks like:

spawn, "foreach i (item1 item2 item3); action $i; end"

An O'Reilly book on shells will help you here, but often it is easier,
and more portable, to perform the action in IDL.

If all fails:
for ii=0,n_elements(files)-1 do $
spawn, "file_dump.ps " + files[ii]

(yeah, I know, lots of overhead, not pretty, but at least it'll work.)

Maarten
--
A: Because it messes up the order in which people normally read text.
Q: Why is top-posting such a bad thing?
A: Top-posting.
Q: What is the most annoying thing on usenet?
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Previous Topic: Tutorial Using idl in java applications???
Next Topic: indexing structure of structures

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ] [ PDF ]

Current Time: Wed Oct 08 20:13:27 PDT 2025

Total time taken to generate the page: 0.00487 seconds