Page 1 of 1

GTKdialog3 program debugging

Posted: Sat 24 Oct 2009, 01:08
by 8-bit
When I create a GTKdialog script, I actually have the script open in Geany.
I have saved said script to a directory and open a terminal in that directory.
I then run the script from the terminal.
Errors are echoed back to the terminal when the script runs and if I see a problem, I exit the program/script , edit it in Geany, save it, and run again.
I did find one thing one has to watch for.
If a called external program run from the script needs some parameters,
look out for those that are also parameters for GTK.
As an example, when running mkdosfs -c -I /dev/sde
the -c is interpreted by GTK as it's own and is not passed to the external program. The same could be said for -f.

Also, in between versions of Puppy, paths to executables seem to have changed and some supporting programs seem to have been removed.

Posted: Sat 24 Oct 2009, 01:33
by 01micko
look out for those that are also parameters for GTK.
As an example, when running mkdosfs -c -I /dev/sde
the -c is interpreted by GTK as it's own and is not passed to the external program. The same could be said for -f.
Does it help if you surround the call with double quotes? Of course these need to be escaped with a back slash.

I always use a functions file, no such problems.

Cheers

Posted: Sat 24 Oct 2009, 02:53
by 8-bit
Well, I had one external program that echoed it's name and version when It started. The version was being interpreted as a destination and I got an error showing the version with a file not found.
I got around this by putting the command with the options I wanted in a variable and running the variable.
For example:
CHKBOX1=mkdosfs -v -c -I
#Other variables are already set up with other parameters.
if condition_met
$CHKBOX1 $PARM1 $PARM2
else
Display message or do another call
fi

The variables are run as a command in their entirety.
But in my two Puppy test cases running the command in a terminal,
in Puppy 4.2.1, if you run #mkdosfs -c -v -I /dev/sde
You get a diskcheck before the format signified by the -c
In Puppy 4.3.1 the -c is ignored.
I assume this since you get feedback showing a diskcheck running in Puppy 4.2.1 and you do not in Puppy 4.3.1