TIP: Click on subject to list as thread! ANSI
echo: rberrypi
to: LEW PITCHER
from: ROBH
date: 2020-09-30 18:35:00
subject: Re: Error with ./install.

On 30/09/2020 16:14, Lew Pitcher wrote:
> On Wed, 30 Sep 2020 14:02:23 +0100, RobH wrote:
>
>> I had to do a reinstall of my linux system due to a faulty ssd, and have
>> a problem with a install.sh script.The said script is included in with
>> lcd files. which I downloaded from github.
>>
>> It is a simple script which runs a realtime clock on a pi zero with an
>> lcd screen.
>>
>> When I run ./install.sh, it fails at ./install.sh: line 34: syntax
>> error: unexpected end of file.
>>
>> I don't know what the syntax should be here;
> [snip]
>
> As others have suggested, the contents and origin of your install.sh
> script are in question. The best choice is to follow up on that, and
> obtain a valid install.sh script.
>
> Failing that, you might try more diagnosis on the current install.sh
> script. You might try some simple shell debugging techniques:
>
> 1) Use the shell to interpret, but not execute, the script by turning on
>     the -n shell option. This will syntax-check the script without allowing
>     it to perform any operations.
>     For example:
>       sh -n ./install.sh
>
> 2) Use the shell to execute the script while displaying the unexpanded
>     shell commands to stdout, by turning on the -v option. This permits
>     you to see exactly the script lines as they are read.
>     For example:
>       sh -v ./install.sh
>
> 3) Use the shell to execute the script while displaying the expanded
>     shell commands to stdout, by turning on the -x option. This permits
>     you to see the exact content of the executed lines.
>     For example:
>       sh -x ./install.sh
>
> Note: the -n, -v and -x option may not be available in all shell
> interpreters. If install.sh is a POSIX shell script, you may execute it
> with bash, which does support these options.
>
> HTH
>

Running the above commands :

rob@rob-Z97:~/Pi_lcd/lcd-master$ sh -n ./install.sh
./install.sh: 34: ./install.sh: Syntax error: end of file unexpected
(expecting "then")

rob@rob-Z97:~/Pi_lcd/lcd-master$ sh -n ./install.sh
./install.sh: 34: ./install.sh: Syntax error: end of file unexpected
(expecting "then")

rob@rob-Z97:~/Pi_lcd/lcd-master$  sh -x ./install.sh
./install.sh: 34: ./install.sh: Syntax error: end of file unexpected
(expecting "then")

So as there are only 33  lines in the script, would the line 34 be
hidden or something with the word "then"

Update:
I copied and pasted the 33 lines into a new file and named it instal.sh,
then ran it.
Result:no errors apart from this one during the install process:

ImportError: No module named RPi.GPIO
./instal.sh: line 15: [: =: unary operator expected

--- SoupGate-Win32 v1.05
* Origin: Agency HUB, Dunedin - New Zealand | FidoUsenet Gateway (3:770/3)

SOURCE: echomail via QWK@docsplace.org

Email questions or comments to sysop@ipingthereforeiam.com
All parts of this website painstakingly hand-crafted in the U.S.A.!
IPTIA BBS/MUD/Terminal/Game Server List, © 2025 IPTIA Consulting™.