Setup-env file won't run
Closed, ResolvedPublic

Description

The bug was observed in Ubuntu 17.10. On executing the shell script, a condition would fail in the code, leading to an exit.

The bug is primarily because of the way the bash has been executed, If the terminal is invoked as a login shell, the command

echo $0

has an output -bash, whereas if the bash is invoked as a non-login shell, the command has an output -/bin/bash

$0 has been used in an if condition which checks whether the bash is invoked or not. However, in case it is a login shell, the condition fails and leads to an exit

if [[ $(uname -s) != "Linux" ]]
then
  echo
  echo "WARNING: uname -s returns something that is not 'Linux', this SDK is designed to be executed on Linux ONLY"
  echo
  return 1 &> /dev/null
  exit 1
fi

More details on this stackoverflow page

The bug is primarily because of the way the bash has been executed, If the terminal is invoked as a login shell, the command

echo $0

has an output -bash, whereas if the bash is invoked as a non-login shell, the command has an output -/bin/bash

$0 has been used in an if condition which checks whether the bash is invoked or not. However, in case it is a login shell, the condition fails and leads to an exit

if [[ $(uname -s) != "Linux" ]]
then
  echo
  echo "WARNING: uname -s returns something that is not 'Linux', this SDK is designed to be executed on Linux ONLY"
  echo
  return 1 &> /dev/null
  exit 1
fi

More details on this stackoverflow page

I added debug information with a99e6400 and added bash with b5191a9d.

Try again after a git pull

tomaluca closed this task as Resolved.Apr 3 2018, 9:24 AM