Technical issues/questions of an intermediate or advanced nature.
-
Ed_P
- Contributor
- Posts: 8374
- Joined: 06 Feb 2013, 22:12
- Distribution: Cinnamon 5.01 ISO
- Location: Western NY, USA
Post#1
by Ed_P » 19 Nov 2023, 03:22
If you run a script you've tweaked and get this:
Code: Select all
guest@porteus:~$ ./mkmods/mkmod50nemobkmks.sh
./mkmods/mkmod50nemobkmks.sh: line 82: unexpected EOF while looking for matching `"'
./mkmods/mkmod50nemobkmks.sh: line 114: syntax error: unexpected end of file
guest@porteus:~$
Don't waste time looking for `"' or each character individually. The fix was replacing "${DRV" with "$DRV" on line
12.
It took me 2 hrs to find the fix. A dumb copy & paste error.
A more useful error message would have been:
Code: Select all
./mkmods/mkmod50nemobkmks.sh: line 82: unexpected EOF while looking for matching }
Ed
Ed_P
-
Rava
- Contributor
- Posts: 5416
- Joined: 11 Jan 2011, 02:46
- Distribution: XFCE 5.01 x86_64 + 4.0 i586
- Location: Forests of Germany
Post#2
by Rava » 26 Nov 2023, 05:13
From
man bash
Have you tried
Code: Select all
--debugger
Arrange for the debugger profile to be executed before the shell
starts. Turns on extended debugging mode (see the description
of the extdebug option to the shopt builtin below).
and/or
?
Cheers!
Yours Rava
Rava
-
Ed_P
- Contributor
- Posts: 8374
- Joined: 06 Feb 2013, 22:12
- Distribution: Cinnamon 5.01 ISO
- Location: Western NY, USA
Post#3
by Ed_P » 26 Nov 2023, 07:00
Rava wrote: ↑26 Nov 2023, 05:13
Have you tried
No. Don't know where to put it in a script.
Rava wrote: ↑26 Nov 2023, 05:13
and/or
No. Don't know where to put it in a script.
To debug I use:
Ed
Ed_P
-
Rava
- Contributor
- Posts: 5416
- Joined: 11 Jan 2011, 02:46
- Distribution: XFCE 5.01 x86_64 + 4.0 i586
- Location: Forests of Germany
Post#4
by Rava » 26 Nov 2023, 14:59
set -x is a good start.
And welcome to coding hell when it comes to bugs in your code. The error output is often not that specific.
But that is where either your own knowledge and coding skills kick in. Or a specialised forum like
Stack Overflow where there are folks much more knowledgable than you and me put together pointing out the
errors of our way error(s) in our code.
Cheers!
Yours Rava
Rava
-
Ed_P
- Contributor
- Posts: 8374
- Joined: 06 Feb 2013, 22:12
- Distribution: Cinnamon 5.01 ISO
- Location: Western NY, USA
Post#5
by Ed_P » 26 Nov 2023, 16:00
Ed
Ed_P