Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

/opt/ibc/scripts/ibcstart.sh: line 157: ${mode^^}: bad substitution #77

Closed
qzi opened this issue Feb 20, 2020 · 5 comments
Closed

/opt/ibc/scripts/ibcstart.sh: line 157: ${mode^^}: bad substitution #77

qzi opened this issue Feb 20, 2020 · 5 comments

Comments

@qzi
Copy link

qzi commented Feb 20, 2020

setting may be not corrected

TWS_MAJOR_VRSN=972 IBC_INI=~/ibc/config.ini TRADING_MODE='paper' IBC_PATH=/opt/ibc TWS_PATH=/Users/**/Applications TWS_SETTINGS_PATH=/Users/**/Jts LOG_PATH=~/ibc/logs TWSUSERID=** TWSPASSWORD=** FIXUSERID=** FIXPASSWORD=** JAVA_PATH=/usr/bin/java

`

=========================== An error has occurred =============================

Error: does not exist
/opt/ibc/scripts/ibcstart.sh: line 157: ${mode^^}: bad substitution

================================================================================

Starting IBC version 3.8.2 on 2020-02-21 at 06:33:41

Operating system: Darwin MacBook-Pro.local 19.3.0 Darwin Kernel Version 19.3.0: Thu Jan 9 20:58:23 PST 2020; root:xnu-6153.81.5~1/RELEASE_X86_64 x86_64

Arguments:

TWS version = 972
Entry point = ibcalpha.ibc.IbcGateway
--tws-path = /Users//Applications
--tws-settings-path = /Users/
/Jts
--ibc-path = /opt/ibc
--ibc-ini = /Users/**/ibc/config.ini
--mode = paper
--java-path = /usr/bin/java
--user = ***
--pw = ***
--fix-user = ***
--fix-pw = ***

=========================== An error has occurred =============================

Error: does not exist

`

@rlktradewright
Copy link
Member

Ok, first there is a new version of the ibcstart.sh script here:

https://github.com/IbcAlpha/IBC/blob/master/resources/scripts/ibcstart.sh

I haven't made a new release since then so just download that into your /opt/ibc/scripts folder. It should fix the 'does not exist' error.

I don't understand the "bad substitution" error message. Have you changed the script in some way? In particular I can't see how this can be output after the "Error: does not exist" message. And I can't see what can be wrong with it, unless ${mode^^} is not valid in macOS bash (but if that were the case, I'd expect others to be complaining about this).

Also in future it would be helpful if you just attach the complete logfile (sanitized for username and password etc) rather than quote the bits you think are interesting: that would make it much easier for me to see what's going on.

@qzi
Copy link
Author

qzi commented Feb 21, 2020

I have fixed another bug in OSX, please review it.

#78

@rlktradewright
Copy link
Member

Your fix is not valid, as has been mentioned more than once before in #59.

${tws_settings_path} can be set to anything the user wants, in the top level scripts, and then the .vmoptions files would not be found.

Use the update file I referred to in my previous response.

@qzi
Copy link
Author

qzi commented Feb 21, 2020

Your fix is not valid, as has been mentioned more than once before in #59.

${tws_settings_path} can be set to anything the user wants, in the top level scripts, and then the .vmoptions files would not be found.

Use the update file I referred to in my previous response.

I checked this file several hours ago, not useful, so I start to fix it. have you checked it in OSX

@rlktradewright
Copy link
Member

As I've pointed out many times before, I don't have access to a Mac, so I'm dependent on other people testing the macOS scripts for me. That's why I don't immediately do a new release when I change these scripts.

Saying you checked the updated file and that it's 'not useful', is itself not useful!. I need to know why it's failing.

By all means give me a valid fix, but also explain why the current latest file doesn't work: also as I said before, please attach (not quote) the full logfile.

Perhaps I should add that the .vmoptions files on macOS are installed (by the IB installer) in a silly place, in ~/Applications/Jts (see the screenshot in #59, and let me know if things are different on your system). This happens to be also the folder where TWS/Gateway store their settings by default, which is why your 'fix' works for you. But the .vmoptions files are not part of the TWS/Gateway settings, they're installation files, and they always stay put.

But if the user wants to store their TWS/Gateway settings elsewhere (which they can do by changing TWS_SETTINGS_PATH in twsstartmacos.sh or gatewaystartmacos.sh or by setting IbDir in config.ini), then ${tws_settings_path} will no longer point to ~/Applications/Jts, so the .vmoptions file won't be found, and that's why your 'fix' isn't generally appropriate.

[On Windows and Linux the .vmoptions files are put in the same folder structure as the application binaries, and that folder structure's path is derived from the TWS_PATH variable in ibcstart.sh and StartIBC.bat: hence changing the TWS settings path doesn't affect finding the .vmoptions file. Why IB did something different for macOS is beyond me...]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants