[SGVLUG] Shell quoting

Dan Kegel dank at kegel.com
Mon Apr 19 09:38:11 PDT 2010


On Mon, Apr 19, 2010 at 9:29 AM, Matt Campbell <dvdmatt at gmail.com> wrote:
> Wow.  And I thought I knew my shell cold.
>
> Does anyone know the logic why this does not work?
>
>     matt at scar:166% bash -c 'echo \'ALTER TABLE\' '
>
>     Unmatched '.
>
> And how this is actually parsed?
>
>     matt at scar:144% bash -c echo 'ALTER TABLE `Components`'
>
>     (returns a blank line)

What are you trying to do?  i.e. what do you want to appear in the final output?
I guess you're generating a shell script that will generate SQL?

- Dan


More information about the SGVLUG mailing list