From: hresquiveloa on
Hi. Can anyone help me to understand why the script shown below will
not work as expected?

foreach line {CAPEMEND/FOR-UP.AT2 CAPEMEND/FOR000.AT2 CHICHI/CHY025-
W.AT2} {
exec bash -c "curl -O http://peer.berkeley.edu/smcat/data/ath/$line"
}

The script goal is to download a set of files (accelerograms) from the
PEER Strong Motion Database... Thank you!
From: Fandom on
Try:

foreach line {CAPEMEND/FOR-UP.AT2 CAPEMEND/FOR000.AT2 CHICHI/CHY025-
W.AT2} {
exec curl -O http://peer.berkeley.edu/smcat/data/ath/$line

}

You don't need 'bash -C' and if you put the curl command between
commas
exec will consider it a single 'word', not a command with parameters.

Andres
From: hresquiveloa on
Andres, thank you for reply.

It is still not working... I mean, it just download the first file...
any idea?

Thank you!
From: scottdware on
On May 25, 11:09 am, hresquiveloa <hresquive...(a)gmail.com> wrote:
> Andres, thank you for reply.
>
> It is still not working... I mean, it just download the first file...
> any idea?
>
> Thank you!

You could try:

foreach line {CAPEMEND/FOR-UP.AT2 CAPEMEND/FOR000.AT2 CHICHI/CHY025-
W.AT2} {
exec {*}[auto_execok curl] -O http://peer.berkeley.edu/smcat/data/ath/$line

}

And see if that works...
From: hresquiveloa on
Neither.

I am thinking of rewriting all the script I made in Tcl using fully
bash syntax... I think it is more straightforward that way.

Thank you scottdware...