Hi all,
I run the script runvdr from the package runvdr-extreme for many years without any problem (I'm not allowed to post links, but it should be easy to find). Now I tried to run it from within LibreElec which gives me the following error
. The corresponding line contains
where ADDPARAMS describes an array.
I tried to run the script with an explicit /bin/bash without any changes.
My skills in scripting are extreme limited and I don't know if it's possible to locate the error without being able to run it on LibreElec but maybe someone has the sparkling idea.
Thanks in advance
Alex
When starting a new thread here, please always tell us what operating system you're using and what shell you're using. Various common utilities behave differently on various operating systems and when run by various shells. Many utilities have options that are available on some operating systems but not on others. If we don't know what environment you're using, we have to guess at what might be happening to you.
You say that you have been running runvdr for years. What has changed since the last time you ran it successfully? Did you install any new software packages, system or application updates, start using a different shell?
What exact command did you use to invoke runvdr?
Exactly what diagnostic messages did it produce when you invoked it?
When the shell tells you it was expecting a }, it usually means that sometime before it issued that complaint it had found a { and it hasn't found a match for it yet to finish what it had been told to do. With the complete diagnostic message and the contents of the script you're running, we might have a much better chance of helping you figure out what happened.
Last edited by Don Cragun; 02-13-2019 at 03:49 PM..
This User Gave Thanks to Don Cragun For This Post:
Hi Don Cragun,
thanks for your answer.
Actually I told you what operating system I (want to) use: LibreElec. It's a JustEnoughOS based (I guess) on Linux from scratch.
Maybe this was misleadingly formulated.
The same script without any changes is running (for years) on the pc I'm working on. Current OS is Ubuntu Trusty. So it's not the script that changed, it's just that I want to run it on LibreElec.
LibreElec uses busybox, but bash is installed.
The script is executable so normaly I run it by invoking runvdr, but as I wrote I also tried /bin/bash /usr/bin/runvdr.
The only diagnostic message is the error message telling me that line 204 produces the error
The script itself is definitely too large to be posted here.
As the script is running on other pc's without any problems I don't think that there's a matching } missing. I found that arrays are handled different in different shells. That's why I tried /bin/bash, the shebang is correct too. So I wonder if the code can be changed so that it's more "universal". Is unset somearray the same as somearray=() ?
So you said this code had been running for years and nothing had changed, but what has changed is that you're trying to run it under a different operating system. That is a HUGE difference.
What version of bash is installed on the system(s) where runvdr is working?
What version of bash is installed on busybox on LibreElec?
You said the shebang is correct... please show us the exact contents of the first line of runvdr.
Can code that is written to run with a specific version of a specific shell be rewritten to be more universal? Probably. Will changing the single line of code:
in a script that is too big to post fix the problem? Almost certainly not. And, believe it or not, the shell that is attempting to run runvdr is telling you that it is looking for a } when it gives you that diagnostic message. It is saying that it gave up looking for the } and reported the error when it found the ( in the array assignment statement. The array assignment is not necessarily the problem; it is just where that shell determined that it was lost while trying to interpret that script.
I've managed to find the script you are talking about from runvdr 0.5.0. I've cut it down to a 59 line script that contains the spirit of what is going on:
Are you getting the same error on line 46 of this script?
These 5 Users Gave Thanks to Chubler_XL For This Post:
Hi 2 all,
i have had AIX 7.2
:/# /usr/IBMAHS/bin/apachectl -v
Server version: Apache/2.4.12 (Unix)
Server built: May 25 2015 04:58:27
:/#:/# /usr/IBMAHS/bin/apachectl -M
Loaded Modules:
core_module (static)
so_module (static)
http_module (static)
mpm_worker_module (static)
... (3 Replies)
Hello.
System : opensuse leap 42.3
I have a bash script that build a text file.
I would like the last command doing :
print_cmd -o page-left=43 -o page-right=22 -o page-top=28 -o page-bottom=43 -o font=LatinModernMono12:regular:9 some_file.txt
where :
print_cmd ::= some printing... (1 Reply)
How to use "mailx" command to do e-mail reading the input file containing email address, where column 1 has name and column 2 containing “To” e-mail address
and column 3 contains “cc” e-mail address to include with same email.
Sample input file, email.txt
Below is an sample code where... (2 Replies)
The system don't boot.
on the screen appears following:
press enter to maintenance (or type CTRL-D to continue)...I checked with format command.
... the slices "0-root","1-swap","2-backup" exist.
...the slises "3-var","6-usr" -unassigned. :( (16 Replies)
logs:
"/home/abc/public_html/index.php"
"/home/abc/public_html/index.php"
"/home/xyz/public_html/index.php"
"/home/xyz/public_html/index.php"
"/home/xyz/public_html/index.php"
how to use "cut" or "awk" or "sed" to get the following result:
abc
abc
xyz
xyz
xyz (8 Replies)
Hi,
I have line in input file as below:
3G_CENTRAL;INDONESIA_(M)_TELKOMSEL;SPECIAL_WORLD_GRP_7_FA_2_TELKOMSEL
My expected output for line in the file must be :
"1-Radon1-cMOC_deg"|"LDIndex"|"3G_CENTRAL|INDONESIA_(M)_TELKOMSEL"|LAST|"SPECIAL_WORLD_GRP_7_FA_2_TELKOMSEL"
Can someone... (7 Replies)
I have a very simple script that reads in the contents of a file (_open.txt) into an array "lyrics":
#!/bin/sh
# read in the text
lyrics=( `cat _open.txt` | tr '\n' ' ')
exit 0
It gives the following error message:
./lyrics.sh: 1: Syntax error: word unexpected (expecting ")")
I have... (9 Replies)
Hi Friends,
Can any of you explain me about the below line of code?
mn_code=`env|grep "..mn"|awk -F"=" '{print $2}'`
Im not able to understand, what exactly it is doing :confused:
Any help would be useful for me.
Lokesha (4 Replies)