[BASH] (own) command is not a valid identifier

Heya fellows

Yes, script-tools and TUI are both my 'children', so i cant go anywhere (else) and ask for help/bugfixes as i need to write them myself.

However i do need help to understand error messages at times (or get hints what else might cause them), so here we go:

Since my new computer is using UEFI, i finaly figured the following command to be useless without some slight modifications.
Anyhow, arguments are finaly parsed properly again, and when bash told me fileXY:line##, the error was there.

But not this one, see yourself: (lines starting with '# | ' are the 'TUI' interface, and tui-str-ask was (3 months ago) renamed to tui-bol-yesno which is a file (command) and not just a function...

[sea@localhost ~]$ st tweak grub2 update
# | Script-Tools (0.9.0)                                                                                2014.01.28 18:21:54 | #
# |                                                      Update GRUB2                                                       | #
# | Requires root access!                                                                                              FAIL | #
[sea@localhost ~]$ sudo st tweak grub2 update
........../usr/share/script-tools/functions/system.isQuestions: line 84: `tui-str-ask': not a valid identifier
[sea@localhost ~]$ grep tui-str-ask /usr/share/script-tools/functions/system.isQuestions
[sea@localhost ~]$

While system.isQuestions looks like:
http://paste.fedoraproject.org/72451/31185139

Just to prove its not the file 'update':

#!/bin/bash
tui-title "Update GRUB2"
[ ! 0 -eq $UID ] && tui-echo "Requires root access!" "FAIL" && return 1

current_distro=$(distro|awk '{print $1}')
grub_efi=/boot/efi/EFI/${current_distro,,}/grub.cfg

[ -f $grub_efi ] && OUTFILE=$grub_efi || OUTFILE=/boot/grub2/grub.cfg

grub2-mkconfig -o $OUTFILE

Actualy, what irritates me the most is:
1) it seems to be caused by root
2) the file /usr/share/script-tools/functions/system.isQuestions doesnt even contain the string 'tui-str-ask'.

So even when calling the program without any args it applies, depending upon root/user-level..

[sea@localhost ~]$ st
# | Script-Tools (0.9.0)                                                                                2014.01.28 18:50:38 | #
# |                                                                                                                         | #
# | Please choose a section. Or go back to exit.                                                                            | #
 1) Back
 2) conf
 3) dev
 4) fas
 5) iso
 6) net
 7) sa
 8) set
 9) ts
10) tweak
#? ^C
[sea@localhost ~]$ sudo st
........../usr/share/script-tools/functions/system.isQuestions: line 84: `tui-str-ask': not a valid identifier
[sea@localhost ~]$ 
[root@localhost script-tools]# pwd
/usr/share/script-tools
[root@localhost script-tools]# for item in $(du|awk '{print $2}');do grep "tui-str-ask" $item/*;done

Reports simply that each entry was not a file (note that i had used this code just a few minutes earlier to find other bugs - which are solved now).

Any ideas please?

The error may be caused by whatever program was using system.isQuestions -- perhaps a function definition never got closed or something.

If that was case, wouldnt there be lots of (follow up) errors (of other functions called) and 'normal user' usage be affected too (and not just root)?

Depends what that code is. Which, at this point, I have no idea.

rofl? :doh: :confused:
It seems 'disabling' the ask function in system.isQuestion solved it...

Just figured i try this, since script-tools' - 'ask' is replaced by tui-bol-yes, i could remove it from script-tools source code...
Weird, i would have expected a diffrent error text.. (but then again, i wouldnt know what)

Sorry for the trouble and thank you

/solved