How can I use shell scripting to iterate an argument that I can use in a Python function like DoublePendulum2.py?
-
Basically I want shell scripting to run something like this: time python DoublePendulum.py 1 1 1 time python DoublePendulum.py 1 2 1 time python DoublePendulum.py 1 4 1 time python DoublePendulum.py 1 8 1 time python DoublePendulum.py 1 16 1 (the program produces specially named png files as output)
-
Answer:
Here's a script that'll work for you. It loops through the numbers in a list and multiplies the argument by two for each iteration. #!/bin/bash NUM=1 for i in {1..5}; do time python DoublePendulum.py 1 $NUM 1 NUM=$[NUM*2] done;
Dan Loewenherz at Quora Visit the source
Related Q & A:
- How can I use a button to retrieve a phone 'number' from contacts?Best solution by Stack Overflow
- How Can I Use A Picture For My Avatar?Best solution by Yahoo! Answers
- How can I use my PC with a wireless printer?Best solution by pcmag.com
- How can i use my laptop as a monitor for my xbox 360?Best solution by Yahoo! Answers
- How can I use a prepaid credit card?Best solution by ehow.com
Just Added Q & A:
- How many active mobile subscribers are there in China?Best solution by Quora
- How to find the right vacation?Best solution by bookit.com
- How To Make Your Own Primer?Best solution by thekrazycouponlady.com
- How do you get the domain & range?Best solution by ChaCha
- How do you open pop up blockers?Best solution by Yahoo! Answers
For every problem there is a solution! Proved by Solucija.
-
Got an issue and looking for advice?
-
Ask Solucija to search every corner of the Web for help.
-
Get workable solutions and helpful tips in a moment.
Just ask Solucija about an issue you face and immediately get a list of ready solutions, answers and tips from other Internet users. We always provide the most suitable and complete answer to your question at the top, along with a few good alternatives below.