Using open process instead of shell

Mike Bonner bonnmike at gmail.com
Mon Dec 25 09:40:01 EST 2017


had one more thought to make it easier.  go back to your original idea of
using a shell script but make the script have the format..

#!/bin/sh
[your command here]
echo "Command Complete"

That way, its easy to see when an individual command finishes.

In addition, if you use 3 separate files, 1 for each of your 3 commands,
named logically, you can easily grok which what to do with each.

Finally, for the [your command here] part.. If you want to be able to run
more than 1 at once, if you pass in your arguments as parameters, you don't
have to rewrite the file each time, you just pass in your changeables and
go.

IIRC $0 will contain the name of the shell script any further parameters
will continue in that vein..

For a very simple example, if your shell script named test.sh were to
contain
#!/bin/sh
ls $1
echo
find . |grep $2
echo "Command Complete"

you can run it with--
./test.sh /var barncard

the output would be a listing of the files in folder /var
a space
and a listing of files and folders from the current directory downward that
contain the string barncard.

Should make it easy enough to fire off jobs, multiple if you wish as long
as your parameters differ (so that the open process string is unique)  This
should make it easy to queue up your commands.. Depending on hardware it
might be possible to have 2 or 3 sets (or more?  no clue what hardware you
have) at once.  It would depend on cpu threads and how much load you wanted
to put on things.

Sorry for all the blabbing, had a good day so my thinker is kinda working.

Everyone have a Merry one!



More information about the use-livecode mailing list