Answer the question
In order to leave comments, you need to log in
How to access global variables in shell script?
#!/bin/bash
cd ../
rm -R --force dist/
npm install
cordova platform rm android
cordova platform add android
cordova prepare
cordova clean
cordova build android
$ANDROID_HOME/tools/bin/sdkmanager --licenses
Answer the question
In order to leave comments, you need to log in
It's called Environment Variables.
It is important how and where you set them. You can view the list of environment variables in the current sh process by executing the command
env
. Environment variables are usually passed to programs and scripts that you run.
If you want to set a variable so that it is passed when the program starts, it must be exported
ANDROID_HOME=/home/user/android
export ANDROID_HOME
ANDROID_HOME=/home/user/android ./script.sh
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question