Unbound variable when running script on embedded device?
Clash Royale CLAN TAG#URR8PPP
up vote
0
down vote
favorite
I have a script that works fine normally, when triggered on my desktop curl -sL https://sentry.io/get-cli/ | bash
.
When I call the same curl
command above but from an embedded device I get:
bash: line 22: !DOWNLOAD_URL_LOOKUP: unbound variable
Why does this only happen on the older embedded device? (Ubuntu 14.04, GNU bash, version 4.3.11(1)-release (arm-unknown-linux-gnueabihf))
Related script:
#!/bin/bash
set -eu
SENTRY_DOWNLOAD_Darwin_x86_64="https://github.com/getsentry/sentry-cli/releases/download/1.26.0/sentry-cli-Darwin-x86_64"
SENTRY_DOWNLOAD_Linux_i686="https://github.com/getsentry/sentry-cli/releases/download/1.26.0/sentry-cli-Linux-i686"
SENTRY_DOWNLOAD_Linux_x86_64="https://github.com/getsentry/sentry-cli/releases/download/1.26.0/sentry-cli-Linux-x86_64"
SENTRY_DOWNLOAD_Windows_i686="https://github.com/getsentry/sentry-cli/releases/download/1.26.0/sentry-cli-Windows-i686.exe"
SENTRY_DOWNLOAD_Windows_x86_64="https://github.com/getsentry/sentry-cli/releases/download/1.26.0/sentry-cli-Windows-x86_64.exe"
VERSION="1.26.0"
PLATFORM=`uname -s`
ARCH=`uname -m`
# If the install directory is not set, set it to a default
if [ -z $INSTALL_DIR+x ]; then
INSTALL_DIR=/usr/local/bin
fi
if [ -z $INSTALL_PATH+x ]; then
INSTALL_PATH="$INSTALL_DIR/sentry-cli"
fi
DOWNLOAD_URL_LOOKUP="SENTRY_DOWNLOAD_$PLATFORM_$ARCH"
DOWNLOAD_URL="$!DOWNLOAD_URL_LOOKUP"
echo "This script will automatically install sentry-cli $VERSION for you."
echo "Installation path: $INSTALL_PATH"
if [ "x$(id -u)" == "x0" ]; then
echo "Warning: this script is currently running as root. This is dangerous. "
echo " Instead run it as normal user. We will sudo as needed."
fi
if [ -f "$INSTALL_PATH" ]; then
echo "error: sentry-cli is already installed."
exit 1
fi
if [ x$DOWNLOAD_URL == x ]; then
echo "error: your platform and architecture ($PLATFORM-$ARCH) is unsupported."
exit 1
fi
if ! hash curl 2> /dev/null; then
echo "error: you do not have 'curl' installed which is required for this script."
exit 1
fi
TEMP_FILE=`mktemp "$TMPDIR:-/tmp/.sentrycli.XXXXXXXX"`
cleanup()
rm -f "$TEMP_FILE"
trap cleanup EXIT
curl -SL --progress-bar "$DOWNLOAD_URL" > "$TEMP_FILE"
chmod 0755 "$TEMP_FILE"
if ! mv "$TEMP_FILE" "$INSTALL_PATH" 2> /dev/null; then
sudo -k mv "$TEMP_FILE" "$INSTALL_PATH"
fi
echo 'Done!'
bash
add a comment |Â
up vote
0
down vote
favorite
I have a script that works fine normally, when triggered on my desktop curl -sL https://sentry.io/get-cli/ | bash
.
When I call the same curl
command above but from an embedded device I get:
bash: line 22: !DOWNLOAD_URL_LOOKUP: unbound variable
Why does this only happen on the older embedded device? (Ubuntu 14.04, GNU bash, version 4.3.11(1)-release (arm-unknown-linux-gnueabihf))
Related script:
#!/bin/bash
set -eu
SENTRY_DOWNLOAD_Darwin_x86_64="https://github.com/getsentry/sentry-cli/releases/download/1.26.0/sentry-cli-Darwin-x86_64"
SENTRY_DOWNLOAD_Linux_i686="https://github.com/getsentry/sentry-cli/releases/download/1.26.0/sentry-cli-Linux-i686"
SENTRY_DOWNLOAD_Linux_x86_64="https://github.com/getsentry/sentry-cli/releases/download/1.26.0/sentry-cli-Linux-x86_64"
SENTRY_DOWNLOAD_Windows_i686="https://github.com/getsentry/sentry-cli/releases/download/1.26.0/sentry-cli-Windows-i686.exe"
SENTRY_DOWNLOAD_Windows_x86_64="https://github.com/getsentry/sentry-cli/releases/download/1.26.0/sentry-cli-Windows-x86_64.exe"
VERSION="1.26.0"
PLATFORM=`uname -s`
ARCH=`uname -m`
# If the install directory is not set, set it to a default
if [ -z $INSTALL_DIR+x ]; then
INSTALL_DIR=/usr/local/bin
fi
if [ -z $INSTALL_PATH+x ]; then
INSTALL_PATH="$INSTALL_DIR/sentry-cli"
fi
DOWNLOAD_URL_LOOKUP="SENTRY_DOWNLOAD_$PLATFORM_$ARCH"
DOWNLOAD_URL="$!DOWNLOAD_URL_LOOKUP"
echo "This script will automatically install sentry-cli $VERSION for you."
echo "Installation path: $INSTALL_PATH"
if [ "x$(id -u)" == "x0" ]; then
echo "Warning: this script is currently running as root. This is dangerous. "
echo " Instead run it as normal user. We will sudo as needed."
fi
if [ -f "$INSTALL_PATH" ]; then
echo "error: sentry-cli is already installed."
exit 1
fi
if [ x$DOWNLOAD_URL == x ]; then
echo "error: your platform and architecture ($PLATFORM-$ARCH) is unsupported."
exit 1
fi
if ! hash curl 2> /dev/null; then
echo "error: you do not have 'curl' installed which is required for this script."
exit 1
fi
TEMP_FILE=`mktemp "$TMPDIR:-/tmp/.sentrycli.XXXXXXXX"`
cleanup()
rm -f "$TEMP_FILE"
trap cleanup EXIT
curl -SL --progress-bar "$DOWNLOAD_URL" > "$TEMP_FILE"
chmod 0755 "$TEMP_FILE"
if ! mv "$TEMP_FILE" "$INSTALL_PATH" 2> /dev/null; then
sudo -k mv "$TEMP_FILE" "$INSTALL_PATH"
fi
echo 'Done!'
bash
Is theDOWNLOAD_URL_LOOKUP
variable set? Maybe it's in your environment but not in/on the devices'?
â Jeff Schaller
Dec 6 '17 at 19:15
@JeffSchaller it is set toDOWNLOAD_URL_LOOKUP="SENTRY_DOWNLOAD_$PLATFORM_$ARCH"
where the 2 variables used are based onuname -s
anduname -m
going to test those commands on the device.
â Philip Kirkbride
Dec 6 '17 at 19:17
You could stave off questions like mine by including the script in your question.
â Jeff Schaller
Dec 6 '17 at 19:18
@JeffSchaller I did link it but I will post the full script as text, since it will likely get updated if we find a fix :-)
â Philip Kirkbride
Dec 6 '17 at 19:19
add a comment |Â
up vote
0
down vote
favorite
up vote
0
down vote
favorite
I have a script that works fine normally, when triggered on my desktop curl -sL https://sentry.io/get-cli/ | bash
.
When I call the same curl
command above but from an embedded device I get:
bash: line 22: !DOWNLOAD_URL_LOOKUP: unbound variable
Why does this only happen on the older embedded device? (Ubuntu 14.04, GNU bash, version 4.3.11(1)-release (arm-unknown-linux-gnueabihf))
Related script:
#!/bin/bash
set -eu
SENTRY_DOWNLOAD_Darwin_x86_64="https://github.com/getsentry/sentry-cli/releases/download/1.26.0/sentry-cli-Darwin-x86_64"
SENTRY_DOWNLOAD_Linux_i686="https://github.com/getsentry/sentry-cli/releases/download/1.26.0/sentry-cli-Linux-i686"
SENTRY_DOWNLOAD_Linux_x86_64="https://github.com/getsentry/sentry-cli/releases/download/1.26.0/sentry-cli-Linux-x86_64"
SENTRY_DOWNLOAD_Windows_i686="https://github.com/getsentry/sentry-cli/releases/download/1.26.0/sentry-cli-Windows-i686.exe"
SENTRY_DOWNLOAD_Windows_x86_64="https://github.com/getsentry/sentry-cli/releases/download/1.26.0/sentry-cli-Windows-x86_64.exe"
VERSION="1.26.0"
PLATFORM=`uname -s`
ARCH=`uname -m`
# If the install directory is not set, set it to a default
if [ -z $INSTALL_DIR+x ]; then
INSTALL_DIR=/usr/local/bin
fi
if [ -z $INSTALL_PATH+x ]; then
INSTALL_PATH="$INSTALL_DIR/sentry-cli"
fi
DOWNLOAD_URL_LOOKUP="SENTRY_DOWNLOAD_$PLATFORM_$ARCH"
DOWNLOAD_URL="$!DOWNLOAD_URL_LOOKUP"
echo "This script will automatically install sentry-cli $VERSION for you."
echo "Installation path: $INSTALL_PATH"
if [ "x$(id -u)" == "x0" ]; then
echo "Warning: this script is currently running as root. This is dangerous. "
echo " Instead run it as normal user. We will sudo as needed."
fi
if [ -f "$INSTALL_PATH" ]; then
echo "error: sentry-cli is already installed."
exit 1
fi
if [ x$DOWNLOAD_URL == x ]; then
echo "error: your platform and architecture ($PLATFORM-$ARCH) is unsupported."
exit 1
fi
if ! hash curl 2> /dev/null; then
echo "error: you do not have 'curl' installed which is required for this script."
exit 1
fi
TEMP_FILE=`mktemp "$TMPDIR:-/tmp/.sentrycli.XXXXXXXX"`
cleanup()
rm -f "$TEMP_FILE"
trap cleanup EXIT
curl -SL --progress-bar "$DOWNLOAD_URL" > "$TEMP_FILE"
chmod 0755 "$TEMP_FILE"
if ! mv "$TEMP_FILE" "$INSTALL_PATH" 2> /dev/null; then
sudo -k mv "$TEMP_FILE" "$INSTALL_PATH"
fi
echo 'Done!'
bash
I have a script that works fine normally, when triggered on my desktop curl -sL https://sentry.io/get-cli/ | bash
.
When I call the same curl
command above but from an embedded device I get:
bash: line 22: !DOWNLOAD_URL_LOOKUP: unbound variable
Why does this only happen on the older embedded device? (Ubuntu 14.04, GNU bash, version 4.3.11(1)-release (arm-unknown-linux-gnueabihf))
Related script:
#!/bin/bash
set -eu
SENTRY_DOWNLOAD_Darwin_x86_64="https://github.com/getsentry/sentry-cli/releases/download/1.26.0/sentry-cli-Darwin-x86_64"
SENTRY_DOWNLOAD_Linux_i686="https://github.com/getsentry/sentry-cli/releases/download/1.26.0/sentry-cli-Linux-i686"
SENTRY_DOWNLOAD_Linux_x86_64="https://github.com/getsentry/sentry-cli/releases/download/1.26.0/sentry-cli-Linux-x86_64"
SENTRY_DOWNLOAD_Windows_i686="https://github.com/getsentry/sentry-cli/releases/download/1.26.0/sentry-cli-Windows-i686.exe"
SENTRY_DOWNLOAD_Windows_x86_64="https://github.com/getsentry/sentry-cli/releases/download/1.26.0/sentry-cli-Windows-x86_64.exe"
VERSION="1.26.0"
PLATFORM=`uname -s`
ARCH=`uname -m`
# If the install directory is not set, set it to a default
if [ -z $INSTALL_DIR+x ]; then
INSTALL_DIR=/usr/local/bin
fi
if [ -z $INSTALL_PATH+x ]; then
INSTALL_PATH="$INSTALL_DIR/sentry-cli"
fi
DOWNLOAD_URL_LOOKUP="SENTRY_DOWNLOAD_$PLATFORM_$ARCH"
DOWNLOAD_URL="$!DOWNLOAD_URL_LOOKUP"
echo "This script will automatically install sentry-cli $VERSION for you."
echo "Installation path: $INSTALL_PATH"
if [ "x$(id -u)" == "x0" ]; then
echo "Warning: this script is currently running as root. This is dangerous. "
echo " Instead run it as normal user. We will sudo as needed."
fi
if [ -f "$INSTALL_PATH" ]; then
echo "error: sentry-cli is already installed."
exit 1
fi
if [ x$DOWNLOAD_URL == x ]; then
echo "error: your platform and architecture ($PLATFORM-$ARCH) is unsupported."
exit 1
fi
if ! hash curl 2> /dev/null; then
echo "error: you do not have 'curl' installed which is required for this script."
exit 1
fi
TEMP_FILE=`mktemp "$TMPDIR:-/tmp/.sentrycli.XXXXXXXX"`
cleanup()
rm -f "$TEMP_FILE"
trap cleanup EXIT
curl -SL --progress-bar "$DOWNLOAD_URL" > "$TEMP_FILE"
chmod 0755 "$TEMP_FILE"
if ! mv "$TEMP_FILE" "$INSTALL_PATH" 2> /dev/null; then
sudo -k mv "$TEMP_FILE" "$INSTALL_PATH"
fi
echo 'Done!'
bash
edited Dec 6 '17 at 19:19
asked Dec 6 '17 at 18:01
Philip Kirkbride
2,2922470
2,2922470
Is theDOWNLOAD_URL_LOOKUP
variable set? Maybe it's in your environment but not in/on the devices'?
â Jeff Schaller
Dec 6 '17 at 19:15
@JeffSchaller it is set toDOWNLOAD_URL_LOOKUP="SENTRY_DOWNLOAD_$PLATFORM_$ARCH"
where the 2 variables used are based onuname -s
anduname -m
going to test those commands on the device.
â Philip Kirkbride
Dec 6 '17 at 19:17
You could stave off questions like mine by including the script in your question.
â Jeff Schaller
Dec 6 '17 at 19:18
@JeffSchaller I did link it but I will post the full script as text, since it will likely get updated if we find a fix :-)
â Philip Kirkbride
Dec 6 '17 at 19:19
add a comment |Â
Is theDOWNLOAD_URL_LOOKUP
variable set? Maybe it's in your environment but not in/on the devices'?
â Jeff Schaller
Dec 6 '17 at 19:15
@JeffSchaller it is set toDOWNLOAD_URL_LOOKUP="SENTRY_DOWNLOAD_$PLATFORM_$ARCH"
where the 2 variables used are based onuname -s
anduname -m
going to test those commands on the device.
â Philip Kirkbride
Dec 6 '17 at 19:17
You could stave off questions like mine by including the script in your question.
â Jeff Schaller
Dec 6 '17 at 19:18
@JeffSchaller I did link it but I will post the full script as text, since it will likely get updated if we find a fix :-)
â Philip Kirkbride
Dec 6 '17 at 19:19
Is the
DOWNLOAD_URL_LOOKUP
variable set? Maybe it's in your environment but not in/on the devices'?â Jeff Schaller
Dec 6 '17 at 19:15
Is the
DOWNLOAD_URL_LOOKUP
variable set? Maybe it's in your environment but not in/on the devices'?â Jeff Schaller
Dec 6 '17 at 19:15
@JeffSchaller it is set to
DOWNLOAD_URL_LOOKUP="SENTRY_DOWNLOAD_$PLATFORM_$ARCH"
where the 2 variables used are based on uname -s
and uname -m
going to test those commands on the device.â Philip Kirkbride
Dec 6 '17 at 19:17
@JeffSchaller it is set to
DOWNLOAD_URL_LOOKUP="SENTRY_DOWNLOAD_$PLATFORM_$ARCH"
where the 2 variables used are based on uname -s
and uname -m
going to test those commands on the device.â Philip Kirkbride
Dec 6 '17 at 19:17
You could stave off questions like mine by including the script in your question.
â Jeff Schaller
Dec 6 '17 at 19:18
You could stave off questions like mine by including the script in your question.
â Jeff Schaller
Dec 6 '17 at 19:18
@JeffSchaller I did link it but I will post the full script as text, since it will likely get updated if we find a fix :-)
â Philip Kirkbride
Dec 6 '17 at 19:19
@JeffSchaller I did link it but I will post the full script as text, since it will likely get updated if we find a fix :-)
â Philip Kirkbride
Dec 6 '17 at 19:19
add a comment |Â
2 Answers
2
active
oldest
votes
up vote
1
down vote
accepted
Not much info to go on here, but did you source the variables? If so, then try to disable variable strictness for the sourced file by calling set +u
just before you source the file, then enable it immediately afterwords with set -u
If you look at the script none of the variables used are assumed to be set. They are all set within the script itself no? sentry.io/get-cli
â Philip Kirkbride
Dec 6 '17 at 19:02
You were right I wasn't familiar with variable indirect expansion syntax so I was surprised an unset variable was being referenced.
â Philip Kirkbride
Dec 6 '17 at 20:04
add a comment |Â
up vote
1
down vote
I think I see what is happening. DOWNLOAD_URL_LOOKUP
gets set to SENTRY_DOWNLOAD_Linux_armv7l
.
Then the line:
DOWNLOAD_URL="$!DOWNLOAD_URL_LOOKUP"
Tries to map the DOWNLOAD_URL
based on the variables set at the start:
SENTRY_DOWNLOAD_Darwin_x86_64="https://github.com/getsentry/sentry-cli/releases/download/1.26.0/sentry-cli-Darwin-x86_64"
SENTRY_DOWNLOAD_Linux_i686="https://github.com/getsentry/sentry-cli/releases/download/1.26.0/sentry-cli-Linux-i686"
SENTRY_DOWNLOAD_Linux_x86_64="https://github.com/getsentry/sentry-cli/releases/download/1.26.0/sentry-cli-Linux-x86_64"
SENTRY_DOWNLOAD_Windows_i686="https://github.com/getsentry/sentry-cli/releases/download/1.26.0/sentry-cli-Windows-i686.exe"
SENTRY_DOWNLOAD_Windows_x86_64="https://github.com/getsentry/sentry-cli/releases/download/1.26.0/sentry-cli-Windows-x86_64.exe"
As these don't include SENTRY_DOWNLOAD_Linux_armv7l
the error is returned. If I add a url for my version the script runs:
SENTRY_DOWNLOAD_Linux_arm7l="https://google.com"
Also it seems the script had an error message for this situation but it set -u
causing the program to exit when an unset variable was referenced.
add a comment |Â
2 Answers
2
active
oldest
votes
2 Answers
2
active
oldest
votes
active
oldest
votes
active
oldest
votes
up vote
1
down vote
accepted
Not much info to go on here, but did you source the variables? If so, then try to disable variable strictness for the sourced file by calling set +u
just before you source the file, then enable it immediately afterwords with set -u
If you look at the script none of the variables used are assumed to be set. They are all set within the script itself no? sentry.io/get-cli
â Philip Kirkbride
Dec 6 '17 at 19:02
You were right I wasn't familiar with variable indirect expansion syntax so I was surprised an unset variable was being referenced.
â Philip Kirkbride
Dec 6 '17 at 20:04
add a comment |Â
up vote
1
down vote
accepted
Not much info to go on here, but did you source the variables? If so, then try to disable variable strictness for the sourced file by calling set +u
just before you source the file, then enable it immediately afterwords with set -u
If you look at the script none of the variables used are assumed to be set. They are all set within the script itself no? sentry.io/get-cli
â Philip Kirkbride
Dec 6 '17 at 19:02
You were right I wasn't familiar with variable indirect expansion syntax so I was surprised an unset variable was being referenced.
â Philip Kirkbride
Dec 6 '17 at 20:04
add a comment |Â
up vote
1
down vote
accepted
up vote
1
down vote
accepted
Not much info to go on here, but did you source the variables? If so, then try to disable variable strictness for the sourced file by calling set +u
just before you source the file, then enable it immediately afterwords with set -u
Not much info to go on here, but did you source the variables? If so, then try to disable variable strictness for the sourced file by calling set +u
just before you source the file, then enable it immediately afterwords with set -u
answered Dec 6 '17 at 18:56
Octavian
1466
1466
If you look at the script none of the variables used are assumed to be set. They are all set within the script itself no? sentry.io/get-cli
â Philip Kirkbride
Dec 6 '17 at 19:02
You were right I wasn't familiar with variable indirect expansion syntax so I was surprised an unset variable was being referenced.
â Philip Kirkbride
Dec 6 '17 at 20:04
add a comment |Â
If you look at the script none of the variables used are assumed to be set. They are all set within the script itself no? sentry.io/get-cli
â Philip Kirkbride
Dec 6 '17 at 19:02
You were right I wasn't familiar with variable indirect expansion syntax so I was surprised an unset variable was being referenced.
â Philip Kirkbride
Dec 6 '17 at 20:04
If you look at the script none of the variables used are assumed to be set. They are all set within the script itself no? sentry.io/get-cli
â Philip Kirkbride
Dec 6 '17 at 19:02
If you look at the script none of the variables used are assumed to be set. They are all set within the script itself no? sentry.io/get-cli
â Philip Kirkbride
Dec 6 '17 at 19:02
You were right I wasn't familiar with variable indirect expansion syntax so I was surprised an unset variable was being referenced.
â Philip Kirkbride
Dec 6 '17 at 20:04
You were right I wasn't familiar with variable indirect expansion syntax so I was surprised an unset variable was being referenced.
â Philip Kirkbride
Dec 6 '17 at 20:04
add a comment |Â
up vote
1
down vote
I think I see what is happening. DOWNLOAD_URL_LOOKUP
gets set to SENTRY_DOWNLOAD_Linux_armv7l
.
Then the line:
DOWNLOAD_URL="$!DOWNLOAD_URL_LOOKUP"
Tries to map the DOWNLOAD_URL
based on the variables set at the start:
SENTRY_DOWNLOAD_Darwin_x86_64="https://github.com/getsentry/sentry-cli/releases/download/1.26.0/sentry-cli-Darwin-x86_64"
SENTRY_DOWNLOAD_Linux_i686="https://github.com/getsentry/sentry-cli/releases/download/1.26.0/sentry-cli-Linux-i686"
SENTRY_DOWNLOAD_Linux_x86_64="https://github.com/getsentry/sentry-cli/releases/download/1.26.0/sentry-cli-Linux-x86_64"
SENTRY_DOWNLOAD_Windows_i686="https://github.com/getsentry/sentry-cli/releases/download/1.26.0/sentry-cli-Windows-i686.exe"
SENTRY_DOWNLOAD_Windows_x86_64="https://github.com/getsentry/sentry-cli/releases/download/1.26.0/sentry-cli-Windows-x86_64.exe"
As these don't include SENTRY_DOWNLOAD_Linux_armv7l
the error is returned. If I add a url for my version the script runs:
SENTRY_DOWNLOAD_Linux_arm7l="https://google.com"
Also it seems the script had an error message for this situation but it set -u
causing the program to exit when an unset variable was referenced.
add a comment |Â
up vote
1
down vote
I think I see what is happening. DOWNLOAD_URL_LOOKUP
gets set to SENTRY_DOWNLOAD_Linux_armv7l
.
Then the line:
DOWNLOAD_URL="$!DOWNLOAD_URL_LOOKUP"
Tries to map the DOWNLOAD_URL
based on the variables set at the start:
SENTRY_DOWNLOAD_Darwin_x86_64="https://github.com/getsentry/sentry-cli/releases/download/1.26.0/sentry-cli-Darwin-x86_64"
SENTRY_DOWNLOAD_Linux_i686="https://github.com/getsentry/sentry-cli/releases/download/1.26.0/sentry-cli-Linux-i686"
SENTRY_DOWNLOAD_Linux_x86_64="https://github.com/getsentry/sentry-cli/releases/download/1.26.0/sentry-cli-Linux-x86_64"
SENTRY_DOWNLOAD_Windows_i686="https://github.com/getsentry/sentry-cli/releases/download/1.26.0/sentry-cli-Windows-i686.exe"
SENTRY_DOWNLOAD_Windows_x86_64="https://github.com/getsentry/sentry-cli/releases/download/1.26.0/sentry-cli-Windows-x86_64.exe"
As these don't include SENTRY_DOWNLOAD_Linux_armv7l
the error is returned. If I add a url for my version the script runs:
SENTRY_DOWNLOAD_Linux_arm7l="https://google.com"
Also it seems the script had an error message for this situation but it set -u
causing the program to exit when an unset variable was referenced.
add a comment |Â
up vote
1
down vote
up vote
1
down vote
I think I see what is happening. DOWNLOAD_URL_LOOKUP
gets set to SENTRY_DOWNLOAD_Linux_armv7l
.
Then the line:
DOWNLOAD_URL="$!DOWNLOAD_URL_LOOKUP"
Tries to map the DOWNLOAD_URL
based on the variables set at the start:
SENTRY_DOWNLOAD_Darwin_x86_64="https://github.com/getsentry/sentry-cli/releases/download/1.26.0/sentry-cli-Darwin-x86_64"
SENTRY_DOWNLOAD_Linux_i686="https://github.com/getsentry/sentry-cli/releases/download/1.26.0/sentry-cli-Linux-i686"
SENTRY_DOWNLOAD_Linux_x86_64="https://github.com/getsentry/sentry-cli/releases/download/1.26.0/sentry-cli-Linux-x86_64"
SENTRY_DOWNLOAD_Windows_i686="https://github.com/getsentry/sentry-cli/releases/download/1.26.0/sentry-cli-Windows-i686.exe"
SENTRY_DOWNLOAD_Windows_x86_64="https://github.com/getsentry/sentry-cli/releases/download/1.26.0/sentry-cli-Windows-x86_64.exe"
As these don't include SENTRY_DOWNLOAD_Linux_armv7l
the error is returned. If I add a url for my version the script runs:
SENTRY_DOWNLOAD_Linux_arm7l="https://google.com"
Also it seems the script had an error message for this situation but it set -u
causing the program to exit when an unset variable was referenced.
I think I see what is happening. DOWNLOAD_URL_LOOKUP
gets set to SENTRY_DOWNLOAD_Linux_armv7l
.
Then the line:
DOWNLOAD_URL="$!DOWNLOAD_URL_LOOKUP"
Tries to map the DOWNLOAD_URL
based on the variables set at the start:
SENTRY_DOWNLOAD_Darwin_x86_64="https://github.com/getsentry/sentry-cli/releases/download/1.26.0/sentry-cli-Darwin-x86_64"
SENTRY_DOWNLOAD_Linux_i686="https://github.com/getsentry/sentry-cli/releases/download/1.26.0/sentry-cli-Linux-i686"
SENTRY_DOWNLOAD_Linux_x86_64="https://github.com/getsentry/sentry-cli/releases/download/1.26.0/sentry-cli-Linux-x86_64"
SENTRY_DOWNLOAD_Windows_i686="https://github.com/getsentry/sentry-cli/releases/download/1.26.0/sentry-cli-Windows-i686.exe"
SENTRY_DOWNLOAD_Windows_x86_64="https://github.com/getsentry/sentry-cli/releases/download/1.26.0/sentry-cli-Windows-x86_64.exe"
As these don't include SENTRY_DOWNLOAD_Linux_armv7l
the error is returned. If I add a url for my version the script runs:
SENTRY_DOWNLOAD_Linux_arm7l="https://google.com"
Also it seems the script had an error message for this situation but it set -u
causing the program to exit when an unset variable was referenced.
edited Dec 6 '17 at 19:57
answered Dec 6 '17 at 19:27
Philip Kirkbride
2,2922470
2,2922470
add a comment |Â
add a comment |Â
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f409267%2funbound-variable-when-running-script-on-embedded-device%23new-answer', 'question_page');
);
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Is the
DOWNLOAD_URL_LOOKUP
variable set? Maybe it's in your environment but not in/on the devices'?â Jeff Schaller
Dec 6 '17 at 19:15
@JeffSchaller it is set to
DOWNLOAD_URL_LOOKUP="SENTRY_DOWNLOAD_$PLATFORM_$ARCH"
where the 2 variables used are based onuname -s
anduname -m
going to test those commands on the device.â Philip Kirkbride
Dec 6 '17 at 19:17
You could stave off questions like mine by including the script in your question.
â Jeff Schaller
Dec 6 '17 at 19:18
@JeffSchaller I did link it but I will post the full script as text, since it will likely get updated if we find a fix :-)
â Philip Kirkbride
Dec 6 '17 at 19:19