Thanks.  As I mentioned, I realize that I can manipulate the awk to
make this instance go away.  I'm looking for a generalized way to make
the shell happy about itself (e.g., in cases where the embedded
language has no provision for such workarounds).

What's especially confusing to me is that it would seem like the
syntax checker should be using the same parser as the shell itself
(and the shell obviously deals properly with the single quote).

I did some more experimentation and the problem only seems to happen
when there are two single-quoted newline-containing strings (that have
no whitespace separation)  in the same statement. This leads me even
more into believing that something isn't quite right with the syntax
checking.

Compare:

    $ cat warning.sh
    #! /bin/ksh

    echo 'a dollar sign requires single quote $
    as does an embedded newline single quote'' $ with
    another line'
    $ ./warning.sh
    a dollar sign requires single quote $
    as does an embedded newline single quote $ with
    another line
    $ ksh -n ./warning.sh
    ./warning.sh: warning: line 3: ' quote may be missing
    $

To:

    $ cat spaceEliminatesWarning.sh
    #! /bin/ksh

    echo 'a dollar sign requires single quote $
    as does an embedded newline single quote' ' $ with
    another line'
    $ ./spaceEliminatesWarning.sh
    a dollar sign requires single quote $
    as does an embedded newline single quote  $ with
    another line
    $ ksh -n ./spaceEliminatesWarning.sh
    $


Jeff


On Thu, Jul 12, 2012 at 2:35 AM, Janis Papanagnou
<[email protected]> wrote:
>
> While you have a point with the ksh -n behavioural difference in your
>
> construct I think you should fix how your scripts tackle the quotes.
>
>
> The problem here is not so much the shell but using the single quotes
> around and inside the inline awk program; you switch the quote level
> inside awk on shell level. See the results if you put the awk program
>
_______________________________________________
ast-users mailing list
[email protected]
https://mailman.research.att.com/mailman/listinfo/ast-users

Reply via email to