¿ªÔÆÌåÓý

ctrl + shift + ? for shortcuts
© 2025 Groups.io

IBC -e Error: no execute permission for scripts in /opt/ibc/scripts


 

Hi, I am new to IBC, and I am trying to install IBC and run IBC. I'm running this on Linux Mint 21.1.
I'll state what I did so far below:
1) Firstly, I've installed the TWS Offline stable 10.19.2a version from Interactive Brokers and installed it.

2) I've followed the IBC user guide and done the following:
i) Downloaded IBCLinux-3.18.0.zip from Github
ii) Typed the following commands in terminal as described in the user guide
sudo unzip ~/Downloads/IBCLinux-3.6.0.zip -d \
/opt/ibc
cd /opt/ibc
sudo chmod o+x *.sh */*.sh
iii) Copied a copy of config.ini from /opt/ibc to ~/ibc and changed the IbLoginID, Password, and TradingMode

3) After which, I've typed the following command into the terminal:
cd /opt/ibc
sh gatewaystart.sh

Both sh twsstart.sh and sh gatewaystart.sh gives the following error:
"""
twsstart.sh: 181: [[: not found
twsstart.sh: 183: [[: not found
-e Error: no execute permission for scripts in /opt/ibc/scripts
"""

"""
gatewaystart.sh: 193: [[: not found
gatewaystart.sh: 195: [[: not found
-e Error: no execute permission for scripts in /opt/ibc/scripts
"""

I'm rather stuck now, am I missing something with the execute permission with the two files in/opt/ibc/scripts? I would think that 'sudo chmod o+x *.sh */*.sh' would have already given the execute permission to both of these files? Or is there something to do with noexec?

Many thanks for your time and love to learn more about this.
- Ong


 

¿ªÔÆÌåÓý

The .sh scripts are Bash scripts, and need to be run using the Bash shell. The standard shell, shis not Bash, and it doesn¡¯t recognise some Bash syntax.

?

Note that the first line of the scripts is

?

#!/bin/bash

?

That line tells Linux what program to use to run the script (look up ¡®shebang¡¯ for more info), if you don¡¯t tell it explicitly. But you are telling it explicitly, so it does what you ask and then sh complains.

?

The correct way to run it is either:

?

bash gatewaystart.sh

?

or (more simply and generally):

?

./ gatewaystart.sh

?

The latter construct forces Linux to honour the shebang.

?

I suspect that when you run it with Bash, the error message about execution permissions in the scripts subfolder will also vanish. If it doesn¡¯t, you¡¯ll need to check the permissions and discover what¡¯s wrong. You need to learn this stuff if you¡¯re going to use Linux, so all I¡¯ll tell you is that you can see the permissions with this command:

?

ls -l /opt/ibc/scripts

?

And you can find out what they mean and how to set them right (though as you observe, the command you used should have set them right in the first place).

?

Richard

?

?

From: [email protected] <[email protected]> On Behalf Of onglitzhi@...
Sent: Wednesday, July 19, 2023 2:40 AM
To: [email protected]
Subject: [ibc] IBC -e Error: no execute permission for scripts in /opt/ibc/scripts

?

Hi, I am new to IBC, and I am trying to install IBC and run IBC. I'm running this on Linux Mint 21.1.
I'll state what I did so far below:
1) Firstly, I've installed the TWS Offline stable 10.19.2a version from Interactive Brokers and installed it.

2) I've followed the IBC user guide and done the following:
i) Downloaded IBCLinux-3.18.0.zip from Github
ii) Typed the following commands in terminal as described in the user guide
sudo unzip ~/Downloads/IBCLinux-3.6.0.zip -d \
/opt/ibc
cd /opt/ibc
sudo chmod o+x *.sh */*.sh
iii) Copied a copy of config.ini from /opt/ibc to ~/ibc and changed the IbLoginID, Password, and TradingMode

3) After which, I've typed the following command into the terminal:
cd /opt/ibc
sh gatewaystart.sh

Both sh twsstart.sh and sh gatewaystart.sh gives the following error:
"""
twsstart.sh: 181: [[: not found
twsstart.sh: 183: [[: not found
-e Error: no execute permission for scripts in /opt/ibc/scripts
"""

"""
gatewaystart.sh: 193: [[: not found
gatewaystart.sh: 195: [[: not found
-e Error: no execute permission for scripts in /opt/ibc/scripts
"""

I'm rather stuck now, am I missing something with the execute permission with the two files in/opt/ibc/scripts? I would think that 'sudo chmod o+x *.sh */*.sh' would have already given the execute permission to both of these files? Or is there something to do with noexec?

Many thanks for your time and love to learn more about this.
- Ong


 

Thank you for your help Richard. And not only that your pointers are very detailed as well.

Initially I did type he following to run it:

./gatewaystart.sh
?
But it gave me this error message below:

./twsstart.sh: line 219: xterm: command not found

I did not know I just needed to install xterm so that's why I used the sh method instead, my bad.
Anyway after sudo apt-get install xterm, then it is running as normal. Thanks again! :)


 

¿ªÔÆÌåÓý

Ah yes, the common Linux distributions like Ubuntu (and possibly Mint as well) used to contain xterm ¡®out-of -the-box¡¯, so the User Guide doesn¡¯t explicitly mention installing it.

?

I¡¯ve just added a note to the User Guide to correct this. In general installing things on Linux is very simple, and something all users need to know how to do, which is why I didn¡¯t do this before.

?

Richard

?