From: hresquiveloa on 25 May 2010 10:54 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 25 May 2010 11:01 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 25 May 2010 11:09 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 25 May 2010 11:39 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 25 May 2010 11:55
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... |