Learn how to read local environment variables and environment variables on the server by shell

USER=abbott
SSH_AUTH_SOCK=/private/tmp/com.apple.launchd.kLlEVaU801/Listeners
PATH=/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/Library/Frameworks/Python.framework/Versions/3.7/bin:/usr/local/mysql/bin:/usr/local/mongodb/bin
PWD=/Users/abbott
UNIVER_MONGO_URL=mongodb://10.10.0.49:27017
LANG=zh_CN.UTF-8
XPC_FLAGS=0x0
XPC_SERVICE_NAME=0
SHLVL=1
HOME=/Users/abbott
LOGNAME=abbott
REACT_APP_SECRET_CODE=mongodb://10.10.0.49:27017
_=/usr/bin/env

this is the environment variable of my computer. How to use shell to read

Apr.01,2021

use env , printenv to see all the available environment variables under the current shell, and use export to see the environment variables that are currently being export, that is, the environment variables that can play a role in the child process.

you can only use ${ENV_VAR_NAME} to read an environment variable in a shell script

MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1b37f6a-2c0e4.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1b37f6a-2c0e4.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?