bug-bash
[Top][All Lists]
Advanced

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

Re: request


From: Greg Wooledge
Subject: Re: request
Date: Fri, 14 Jul 2017 09:38:03 -0400
User-agent: NeoMutt/20170113 (1.7.2)

On Fri, Jul 14, 2017 at 11:09:25AM +0200, t wrote:
> #========================================
> [me@linuxbox me]$ ./trouble.bash
> ./trouble.bash: line 8430: unexpected EOF while looking for matching "
> ./trouble.bash: line 8440 systax error: unexpected end of file

Your problem is that your script is about 8300 lines longer than it
should be.  Writing a bash script that's over ~100 lines is crazy.

Yours is over 8000 lines.

I have no words.

> echo "We suggest check $VAR"
> echo "because this lines of file, contain an odd number of quotes "

But lines are explicitly *allowed* to contain an odd number of quotes.
This is how multi-line string constants are created.

body="This is the body of an email.  It has
multiple lines.  There are so many words
that they don't all fit on one line."

When the parser encouters a syntax error, it *cannot* know where the real
problem is; only that there *is* one, somewhere.  You as the programmer
have to be the one to track it down and fix it.

You know that the syntax error originates somewhere *on* or *before*
the line number where the parser hit the brick wall and stopped.  That's
all you know.  You don't know whether it's actually a missing quote.
It could be a missing } or a missing fi or a missing esac or a missing
done, or ANY OTHER missing or incorrect syntax element.

That is *one* of the reasons why bash scripts should be kept small.

> 2. Please hide e-mail for google bots, or remove this e-mail after read.

Screw you.  (And yes, this is the sanitized version.)



reply via email to

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