How to solve the version issue of Bash in my Ubuntu?
I'm trying to execute a shell script in my Ubuntu VPN terminal.
My Bash version is:
GNU bash, version 4.3.46(1)-release (x86_64-pc-linux-gnu)
My shell script is:
#!/bin/bash ... ...
I have given permissions for it like so:
chmod +x _myscript.sh ex -sc $'%s/\r$//e|x' _myscript.sh sh _myscript.sh
I get this error:
syntax error in conditional expression: unexpected token `(‘
which is because of lower Bash version, I found out after doing research.
The solution I found was to add this line after Bash declaration:
[code language="bash"] shopt -s extglob [/code]
I need to know where in the script i need to give the above line.
I tried just after
#!/bin/bash in my script, but I still get the same error.