Sample Header Ad - 728x90

Passing math equations as parameters to a looping function

-1 votes
1 answer
77 views
I want to run several jobs in parallel using the a script that does serial calls to a parameterized script and submits it as a background job on each call. It's for a brute force script which on each call will run 1k of 10k total combinations. The following is my first hack at it. #!/bin/bash for i in $(seq 10) do ./tmp/tmpsky/bd25Par.sh (i*1000-1000) (i*1000) & done I want $1 to evaluate as 0,1000,2000 etc...and $2 to evaluate to 1000,2000,3000 etc. The & is to submit the script as a background job. The called module will pass $1 and $2 to be used with seq as follows #/bin/bash/ for n in $(seq $1 1 $2) do ...` The first script fails with unexpected token 'i*1000-1000' What have I done wrong?
Asked by Info5ek (503 rep)
Sep 28, 2016, 04:06 AM
Last activity: Mar 22, 2024, 05:46 PM