You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Jul 16, 2024. It is now read-only.
When running the source rl_coach/env.sh on a mac, the following errors are thrown:
hostname: illegal option -- i
usage: hostname [-fs] [name-of-host]
readlink: illegal option -- f
usage: readlink [-n] [file ...]
Looking around the web, readlink on OSX isn't standard (naturally). But a port of it can be installed by:
brew install coreutils
That then gives a greadlink that works in the same way as on other platforms (i.e. it supports the -f option).
I think the -i on hostname is trying to get the IP address of the local machine? On OSX that can be got with:
ipconfig getifaddr en0
But that's perhaps a little brittle as you need to specify which network interface to check. The following command is a little less brittle, but returns multiple IPs (for each interface):
I just tested that with my wifi + LAN on/off and it did detect the switch over correctly (i.e. always giving me an active IP). So maybe that's the solution?
The text was updated successfully, but these errors were encountered:
Hi,
When running the
source rl_coach/env.sh
on a mac, the following errors are thrown:Looking around the web, readlink on OSX isn't standard (naturally). But a port of it can be installed by:
brew install coreutils
That then gives a greadlink that works in the same way as on other platforms (i.e. it supports the -f option).
I think the -i on hostname is trying to get the IP address of the local machine? On OSX that can be got with:
ipconfig getifaddr en0
But that's perhaps a little brittle as you need to specify which network interface to check. The following command is a little less brittle, but returns multiple IPs (for each interface):
ifconfig | grep "inet " | grep -Fv 127.0.0.1 | awk '{print $2}'
Or perhaps just limit the grep to give a single result:
ifconfig | grep "inet " | grep -m 1 -Fv 127.0.0.1 | awk '{print $2}'
I just tested that with my wifi + LAN on/off and it did detect the switch over correctly (i.e. always giving me an active IP). So maybe that's the solution?
The text was updated successfully, but these errors were encountered: