Both sides previous revisionPrevious revisionNext revision | Previous revision |
config:env [2018/04/23 17:15] – [bash/sh] Mention 'env' and 'printenv' utils for setting/testing environment changes digital man | config:env [2023/02/12 14:26] (current) – [Debian-based Linux] Provide a better example: put env vars in .profile, not .bashrc digital man |
---|
===== SBBSEXEC ===== | ===== SBBSEXEC ===== |
| |
The ''SBBSEXEC'' environment variable //may// be set to the path of your Synchronet ''[[dir:exec]]'' directory. This may be needed for some development situations. | The ''SBBSEXEC'' environment variable //may// be set to the path of your Synchronet ''[[dir:exec]]'' directory. This may be needed for some development situations (e.g. where your Synchornet ''exec'' directory is not ''../exec'' relative to your Synchronet ''[[dir:ctrl]]'' directory). Most sysops will not need to set this environment variable. |
| |
===== SBBSNODE ===== | ===== SBBSNODE ===== |
(replace ''c:\sbbs\ctrl'' with the full path to your ''[[dir:ctrl]]'' directory) | (replace ''c:\sbbs\ctrl'' with the full path to your ''[[dir:ctrl]]'' directory) |
| |
| ==== Debian-based Linux ==== |
| (Yes, this includes Ubuntu Linux) |
| |
| See https://wiki.debian.org/EnvironmentVariables |
| |
| Example ''~/.profile'' addition that both sets the ''SBBSCTRL'' variable and adds the Synchronet ''[[dir:exec]]'' directory to the search path: |
| <code sh> |
| export SBBSCTRL=/sbbs/ctrl |
| export PATH=$PATH:/sbbs/exec |
| </code> |
==== bash/sh ==== | ==== bash/sh ==== |
| |
| |
SBBSCTRL=/sbbs/ctrl && export SBBSCTRL | SBBSCTRL=/sbbs/ctrl && export SBBSCTRL |
(replace ''/sbbs/ctrl'' with the full path to your ''[[dir:ctrl]]'' directory) | (replace ''/sbbs/ctrl'' with the full path to your Synchronet ''[[dir:ctrl]]'' directory) |
| |
=== /etc/profile === | === /etc/profile === |
| |
=== sudo === | === 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: | 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 in the parent shell: |
| |
sudo -E sbbs | sudo -E sbbs |
=== Testing === | === 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): | You can use either of the following command-lines to test if a particular environment variable is set correctly (the environment variable's current value should be printed in response to either): |
| |
* ''echo $SBBSCTRL'' | * ''echo $SBBSCTRL'' |
| ''SBBSNNUM'' | Current node number | ''1'' | | | ''SBBSNNUM'' | Current node number | ''1'' | |
| ''PCBNODE'' | Current node number (only for DOS programs) | ''1'' | | | ''PCBNODE'' | Current node number (only for DOS programs) | ''1'' | |
| | ''PCBDRIVE'' | Current node drive letter | ''C:'' | |
| | ''PCBDIR'' | Current node path (sans drive letter) | ''\SBBS\NODE1\'' | |
| ''DAY'' | Current day of the month (01-31 ) | ''01'' | | | ''DAY'' | Current day of the month (01-31 ) | ''01'' | |
| ''WEEKDAY'' | Current day of the week abbreviation | ''Mon''| | | ''WEEKDAY'' | Current day of the week abbreviation | ''Mon''| |
| |
| |
| ===== See Also ===== |
| * [[:config:|Configuration]] |
| |
| |
| {{tag>configuration operating_system}} |