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


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting [BASH] (own) command is not a valid identifier
# 1  
Old 01-28-2014
Bug [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...

Code:
[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':
Code:
#!/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..
Code:
[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 ~]$

Code:
[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?
# 2  
Old 01-28-2014
The error may be caused by whatever program was using system.isQuestions -- perhaps a function definition never got closed or something.
# 3  
Old 01-28-2014
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)?
# 4  
Old 01-28-2014
Depends what that code is. Which, at this point, I have no idea.
# 5  
Old 01-28-2014
rofl? :doh: Smilie
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
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Bash script accepting variables in valid number format

Hi Experts I would like to ask if there is a way to validate if the variable passed is in this kind of sample format "06-10" or "10-01". It was really a challenge to me on how to start and echnically the "6-10" stands for "June 10" and "10-01" stands as "October 1", overall it needs to have ... (3 Replies)
Discussion started by: ersan-poguita
3 Replies

2. Shell Programming and Scripting

Bash to create new directory by date followed by identifier and additional subdirectories

I have a bash that downloads a list and if that list has data in it then a new main directory is created (with the date) with several subdirectories (example1, example2, example3). My question is in that list there are portion of specific file types (.vcf.gz) - identifier towards the end that have... (0 Replies)
Discussion started by: cmccabe
0 Replies

3. Shell Programming and Scripting

403-009 The specified number is not valid for this command.

Error Message: dm2_oraver: 9xdm2_oraver2: LT11/w_standard/gold_wh/install/dm2_updatetns.ksh: 11MAR13: 0403-009 The spe cified number is not valid for this command. if means the line number in the ksh, it is ((CntNew=Cnt+1)). Please let me know the best way to debug and find it out. I am... (4 Replies)
Discussion started by: Daniel Gate
4 Replies

4. Shell Programming and Scripting

0403-009 The specified number is not valid for this command

Hi, Am using a if condition to match a pattern but I get the following error.. if then echo "The value is $hidType" return 0 elseif -a ] echo "The value is $hidType" return 0 fi I get the following error + echo The value is mode The value is mode + ./a2: mode:... (2 Replies)
Discussion started by: Priya Amaresh
2 Replies

5. Homework & Coursework Questions

Bash shell - Check if value is valid directory.

1. The problem statement, all variables and given/known data: The script usage will be as follows: library.third source_directory - Your script will display an appropriate error message and exit with status 3 if no parameters are given - Your script will display an appropriate error... (2 Replies)
Discussion started by: netmaster
2 Replies

6. Shell Programming and Scripting

A test command parameter is not valid

Hello, Getting error "A test command parameter is not valid" when trying to run the code below under /sbin/sh AA = "12:00" CHK=$(date +"%H:%M") if then print "Yes" fi Getting 2 errors: 1) "AA: not found" 2) "Specify a parameter with this command" Thanks, IS Please... (5 Replies)
Discussion started by: schureki
5 Replies

7. Shell Programming and Scripting

awk command - not a valid identifier message

Trying to run the following awk command : export com.mics.ara.server.tools.sch_reports.Runner.num_threads=`awk -F= '!/^#/ && /com.mics.ara.server.tools.sch_reports.Runner.num_threads/{print $2}' $BKUPDIR/env.properties` -bash: export:... (6 Replies)
Discussion started by: venhart
6 Replies

8. Shell Programming and Scripting

Whether a string is a valid unix command

How to find a string which is entered in command promt is a valid unix command or not?. Thanks in advance ~Saravana (2 Replies)
Discussion started by: tsaravanan
2 Replies

9. Shell Programming and Scripting

': not a valid identifier

I am trying to write a bash script. I am able to do simple things like pass arguments, assign variables and echo the results. However, when I try to declare and array or anything a little more complicated I get ': not a valid identifier Here is my code so far: #!/bin/bash echo start t... (7 Replies)
Discussion started by: script123
7 Replies

10. UNIX for Dummies Questions & Answers

pwd: A specified flag is not valid for this command.

Probably a very straight forward question but please be easy on me, I am v. new to UNIX! A script that I have runs the line tmp=`pwd -H` It works fine, but I needed to make a couple of other changes to the script, nowhere near this line but now this line reports: pwd: A specified flag... (2 Replies)
Discussion started by: Paxton
2 Replies
Login or Register to Ask a Question