making a script..
I am using a program that runs in this way (for university)
i call it from bask with this syntax: ./nameprogram inp=inpfile xsdir=xsdir2 it runs for around 5 hours then gives me 3 files after that, i start again with another filename runs for 5 hours again, then gives me 3 different files (the program looks for the filename and appends 1-2-3 to different files) now since i can't be there every 5 hours to start again, i wish to make a script that would do for me: i should start the script and it would care of all the files i list for example on a file by running the program with each one of them.. where can i find info about how to do that? Thanks |
Tried perl? Hmmm, haven't used it for some time now, but it should be somthing like this:
Code:
#!/usr/bin/perl |
You could set it up as a cron job instead of a script.
|
Thought about that too, but what assasukasse want to just put in some filenames, and let it execute itself. Sort of like a frontend. And why a Cron job? Can't we have some multiprocessing here? That's why I used "exec" instead of "system". Hello, we're in XXI century!
|
You can pass several commands to the bash by seperating them with semicolons.
E. g, you could enter: Code:
./nameprogram inp=inpfile1 xsdir=xsdir2 ; ./nameprogram inp=inpfile2 xsdir=xsdir2 ; ./nameprogram inp=inpfile3 xsdir=xsdir2 good luck, Lotharster |
with some help on irc i finally wrote this:
#!/bin/sh echo "---------------------------------------------" echo " script by assasukasse, linux only please" echo "---------------------------------------------" mkdir ./done for I in `ls *.w` do echo "start $I" ./xyz inp=$I xsdir=xsdir2 mv $I ./done echo "done $I" done it works wonderfully..however i have a small problem.. i wish to give more visibility to the echoes.. how can i color them? Thanks |
Google helps:
http://www.faqs.org/docs/abs/HTML/colorizing.html Quote:
|
All times are GMT -5. The time now is 04:38 AM. |