help-bash
[Top][All Lists]
Advanced

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

Re: feature request : at ' unexpected end of fille ' error msg append al


From: Zachary Santer
Subject: Re: feature request : at ' unexpected end of fille ' error msg append also the still-open direcrive
Date: Thu, 5 Sep 2024 08:34:53 -0400

On Fri, Aug 16, 2024 at 9:26 AM Chet Ramey <chet.ramey@case.edu> wrote:
>
> On 8/16/24 8:49 AM, alex xmb sw ratchev wrote:
> > .. extend that err msg to include info where what is open
> >
> > .. i had some times it wasnt easy to see where what is open
> > just like with my same - hour post
>
> bash-5.3 includes line number information where the unclosed construct
> (case/select/for/if/while/until) begins in error messages. For example,
>
> for f in 1 2 3 4
> do
>         while true; do
>                 echo abcde
>         done
>
> produces
>
> x3: line 6: syntax error: unexpected end of file from command on line 1

The latest devel branch push also "track[s] initial line number of
`{'', `(', and `[[' compound commands" for these error messages.

Would it also be useful to track where double- and single-quoted
strings began? An editor with shell syntax highlighting should point
that out, though I've managed to trick the syntax highlighting in the
gedit that comes with RHEL 7 with some pretty standard stuff.

How about here documents? Anything else?



reply via email to

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