Unbound variable when running script on embedded device?

The name of the pictureThe name of the pictureThe name of the pictureClash 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!'






share|improve this question






















  • 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










  • 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














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!'






share|improve this question






















  • 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










  • 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












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!'






share|improve this question














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!'








share|improve this question













share|improve this question




share|improve this question








edited Dec 6 '17 at 19:19

























asked Dec 6 '17 at 18:01









Philip Kirkbride

2,2922470




2,2922470











  • 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










  • 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










  • @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










  • @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










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






share|improve this answer




















  • 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

















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.






share|improve this answer






















    Your Answer







    StackExchange.ready(function()
    var channelOptions =
    tags: "".split(" "),
    id: "106"
    ;
    initTagRenderer("".split(" "), "".split(" "), channelOptions);

    StackExchange.using("externalEditor", function()
    // Have to fire editor after snippets, if snippets enabled
    if (StackExchange.settings.snippets.snippetsEnabled)
    StackExchange.using("snippets", function()
    createEditor();
    );

    else
    createEditor();

    );

    function createEditor()
    StackExchange.prepareEditor(
    heartbeatType: 'answer',
    convertImagesToLinks: false,
    noModals: false,
    showLowRepImageUploadWarning: true,
    reputationToPostImages: null,
    bindNavPrevention: true,
    postfix: "",
    onDemand: true,
    discardSelector: ".discard-answer"
    ,immediatelyShowMarkdownHelp:true
    );



    );













     

    draft saved


    draft discarded


















    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






























    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






    share|improve this answer




















    • 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














    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






    share|improve this answer




















    • 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












    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






    share|improve this answer












    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







    share|improve this answer












    share|improve this answer



    share|improve this answer










    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
















    • 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












    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.






    share|improve this answer


























      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.






      share|improve this answer
























        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.






        share|improve this answer














        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.







        share|improve this answer














        share|improve this answer



        share|improve this answer








        edited Dec 6 '17 at 19:57

























        answered Dec 6 '17 at 19:27









        Philip Kirkbride

        2,2922470




        2,2922470



























             

            draft saved


            draft discarded















































             


            draft saved


            draft discarded














            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













































































            Popular posts from this blog

            How to check contact read email or not when send email to Individual?

            Displaying single band from multi-band raster using QGIS

            How many registers does an x86_64 CPU actually have?