On Wed, 30 Sep 2020 20:16:25 +0100, RobH declaimed the
following:
>On 30/09/2020 19:23, Dennis Lee Bieber wrote:
>> diff instal.sh install.sh
>
>Output as requested:
>
>rob@rob-Z97:~/Pi_lcd/lcd-master$ diff instal.sh install.sh
>2,4c2,4
>< if [ "$(id -u)" != "0" ]; then
>< echo "Please re-run as sudo."
>< exit 1
>---
> > if [ "$(id -u)" != "0" ]: then
> > echo "Please re-run as sudo."
> > exit 1
Don't know if indentation means anything to the shell, but your top
file has a ";" where the second has a ":".
https://docstore.mik.ua/orelly/unix3/upt/ch28_16.htm
"""
When the shell sees a semicolon (;) on a command line, it's treated as a
command separator -- basically like pressing the ENTER key to execute a
command.
"""
Based upon
https://www.geeksforgeeks.org/conditional-statements-shell-script/ the
"then" is taken as a command (the examples all put it on the line UNDER the
"if") so the ";" is likely correct. No idea what the ":" version was doing
with it... Other than not seeing the "then" as a command.
>32,33c32,33
>< read -n1 -s
>< sudo reboot
>---
> > read -n1 -s:
> > sudo reboot:
And here, both of the lines from the second file have ":" at the end.
You seem to have /something/ that seems to have created a lot of ":" where
they don't belong.
--
Wulfraed Dennis Lee Bieber AF6VN
wlfraed@ix.netcom.com http://wlfraed.microdiversity.freeddns.org/
--- SoupGate-Win32 v1.05
* Origin: Agency HUB, Dunedin - New Zealand | FidoUsenet Gateway (3:770/3)
|