bug-bash
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Interesting problem writing bash script to execute commands from SQL


From: Pierre Gaston
Subject: Re: Interesting problem writing bash script to execute commands from SQL
Date: Fri, 29 Aug 2008 16:30:54 +0300

On Thu, Aug 28, 2008 at 8:25 PM, juliodm <address@hidden> wrote:
>
> I'm writing a bash script to that will execute commands from a database.
> What I mean is that the MySQL database contains commands that bash will pull
> and then run itself.
>
> My problem is that some of the commands contain single quotes, as needed by
> the shell app it plans to run.
> When I write a line like the one below directly in the bash script:
> `myapp -f dosomething -s 'do_some_other_thing -p some_more_things' -l
> end_of_my_line`
>
> It works fine.... but when I assign it to a variable like:
> COMMAND="myapp -f dosomething -s 'do_some_other_thing -p some_more_things'
> -l end_of_my_line"
> $COMMAND

See:
http://wooledge.org:8000/BashFAQ#head-df4f1d6edc5630c40f6876dcff9e21407d49308c




reply via email to

[Prev in Thread] Current Thread [Next in Thread]