Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
Next revisionBoth sides next revision
config:env [2017/12/04 20:43] – Added new 'automatic' section to detail the env variables set by sbbs digital manconfig:env [2018/04/23 17:15] – [bash/sh] Mention 'env' and 'printenv' utils for setting/testing environment changes digital man
Line 45: Line 45:
 (replace ''/sbbs/ctrl'' with the full path to your ''[[dir:ctrl]]'' directory) (replace ''/sbbs/ctrl'' with the full path to your ''[[dir:ctrl]]'' directory)
  
 +=== /etc/profile ===
 +In Debian and Debian-based Linux distributions (e.g. Ubuntu), you can also set environment variables in your ''/etc/profile'' file (and/or ''~/.profile''), like so:
 +
 +  export SBBSCTRL=/sbbs/ctrl
 +  
 +=== env ===
 +You may also use the ''env'' utility to set an environment variable for a specific program invocation:
 +
 +  env SBBSCTRL=/sbbs/ctrl /sbbs/exec/sbbs
 +  
 +Note: You can use the same syntax **without** the ''env'' part. The environment variable(s) specified will only be set for the life of the process being invoked.
 +
 +=== sudo ===
 +When using the ''sudo'' command to execute a Synchronet program with elevated (e.g. root) privileges, you may need to pass the ''-E'' option to preserve the environment variables set the parent shell:
 +
 +  sudo -E sbbs
 +  
 +=== Testing ===
 +
 +You can use either of the following command-lines to test if a particular environment variable is set correctly (the environment variable value should be printed in response to either):
 +
 +  * ''echo $SBBSCTRL''
 +  * ''printenv SBBSCTRL''
 +
 +
 + 
 ==== csh/tcsh ==== ==== csh/tcsh ====
  
config/env.txt · Last modified: 2023/02/12 14:26 by digital man
Back to top
CC Attribution 4.0 International
Driven by DokuWiki Recent changes RSS feed Valid CSS Valid XHTML 1.0