[colug-432] Bash fun

Tom Hanlon tom at functionalmedia.com
Sun Nov 1 11:10:44 EST 2009


Colug...


too funny, every time I post a question I find the answer the moment I  
hit send.

Looks like I want "eval"

Anyhow... any general bash advice in regards to writing good scripts,  
good tutorials, etc.

I was tempted to go with Python because I could use the python  
practice, but I could also use the bash practice.

This will be run on linux, but also open solaris....

Is open solaris fair game for discussion ? How about open solaris with  
bulged capacitors on Motherboard ;-)

So bash open solaris, environment issues.. ?? Are there any I need to  
be aware of.

--
Tom



On 1 Nov 2009, at 11:02, Tom Hanlon wrote:

> Colug,
>
> I am writing a script that takes a file of MySQL queries. I want to
> read that file and then run explain for each query in the file and
> gather a subset of the output generated.
>
> So basic process is.
>
> given file
>
> select this from that;
> select that from this;
>
> I want to run
>
> mysql -u user -ppass -e "explain select this from that" >>file.out.
> mysql -u user -ppass -e "explain select that from this" >>file.out.
>
> I am reading the lines from the file.. no problem, I am assigning them
> to variables.
>
> The exec, or eval or whatever it takes to fork a process and keep on
> going is holding me up a little bit.
>
> #!/bin/bash
> while read line
> do
> echo  $line;
> ######
> # exec seems to exit
> #
> ## exec who;
> done
>
>
>
> Thanks,
>
> Tom
> _______________________________________________
> colug-432 mailing list
> colug-432 at colug.net
> http://lists.colug.net/mailman/listinfo/colug-432



More information about the colug-432 mailing list