When initializing the command shell of the SpresenseSDK, I defined the variable in export as follows, but the value is blank.
·The previous SDK version (v2.2.0) worked well.
·The new SDK version (v2.4.0) will not work.The value of the variable will be blank.
For example, have you changed the way you use the command, or are there any missing configuration settings?
·CONFIG_NSH_VARS=Y
·NSH_DISABLE_ENV=N
sh/mnt/sd0/export.txt
sh/mnt/sd0/sample1
export DEF_SAMPLE10
export DEF_SAMPLE2"/mnt/sd0/"
sh/mnt/sd0/sample2&
echo$DEF_SAMPLE1 ← NG with new SDK; blank data; OK with old SDK
echo${DEF_SAMPLE2} ← NG with new SDK; blank data; OK with old SDK
According to NuttX Environment Variables, environment variables are managed by task group.
https://nuttx.apache.org/docs/latest/reference/user/09_env_vars.html
If you create a process with sh
, and then export
, the environment variable disappears as soon as the process ends.I don't know why the old SDK version worked, but the new SDK version seems to behave as designed (as far as the documentation and code are concerned).
If you use source
instead of sh
, I think the case for this question will work as intended.
source/mnt/sd0/export.txt
sh/mnt/sd0/sample1
547 Who developed the "avformat-59.dll" that comes with FFmpeg?
542 Unable to install versioned in Google Colab
546 Understanding How to Configure Google API Key
536 Uncaught (inpromise) Error on Electron: An object could not be cloned
548 rails db:create error: Could not find mysql2-0.5.4 in any of the sources
© 2024 OneMinuteCode. All rights reserved.