Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

Export variable containing special characters(args)

I want to export CELERY_ARGS

CELERY_ARGS="--prefetch-multiplier=1 --loglevel=info --concurrency=1"

But when I export, I get the following issue.

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

export $CELERY_ARGS
bash: export: --: invalid option
export: usage: export [-fn] [name[=value] ...] or export -p

Any suggestions. Thanks

>Solution :

Exporting isn’t something you do with a value; it’s something you do to a name.

export CELERY_ARGS

adds CELERY_ARGS to a list of variable names (if it isn’t already there) whose values should be added to the environment of a child process when it is started.

Note that this means it doesn’t matter what the value of CELERY_ARGS is when you export the name (or even if the variable is defined yet); the value received by the child process is the value at process creation.

For example,

$ printenv bar
$ bar=7
$ printenv bar
$ export bar
$ bar=9
$ printenv bar
9
Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading