TIP: Click on subject to list as thread! ANSI
echo: synchronet
to: KK4QBN
from: DIGITAL MAN
date: 2018-02-15 23:48:00
subject: Re: Raspberry PI synchron

  Re: Re: Raspberry PI synchron
  By: KK4QBN to John H. Guillory on Fri Feb 16 2018 01:01 am

 > And though i've done this. anyway I look at it, when I try to load
 > envorinment varaibles, even in a very simple script, EXCEPT for scfg, the
 > SBBSCTRL environment will not set.

What do you mean "EXCEPT for scfg"? There's nothing special about scfg.

 > not will it work in .profile .bash-profile .bashrc

On what OS?

On Ubunu Linux or Debian Linux:

1. edit the file /etc/profile
2. after the last line, add one line: export SBBSCTRL=/path/to/ctrl
3. reboot
4. at a terminal command prompt, type: echo $SBBSCTRL
5. Do you see /path/to/ctrl? Then "it worked".

 > simple script
 >
 > #!/bin/sh and tried bash
 > SBBSCTRL=/sbbs/ctrl && export SBBSCTRL && sudo /sbbs/exec/sbbs [triggers,
 > etc] exit

You don't need 2 different steps (ENV_VAR = val, then export) you can do it
with a single operation: export ENV_VAR = val, for example:

export SBSBCTRL=/path/to/ctrl && sudo /sbbs/exec/sbbs

 > I've tried this directly from a CLI and it still states SBBSCTRL environment
 > not set.

Then you did something wrong.

 > SCFG does'nt give the issues after being loaded stating it cannot
 > find the ctrl dir when loading directly like this or from a script.

SCFG and SBBS and JSEXEC and SBBSECHO, etc. all use exactly the same method
reading the SBBSCTRL environment variable.

 > in my ~/.bashrc ~/.bash-profile and ~/profile I have:
 >
 > SBBSCTRL=/sbbs/ctrl && export SBBSCTRL

Maybe try "export SBBSCTRL=/path/to/ctrl" instead.

 > it is also setup in /etc/prfile btw.

Works for me. What flavor of Linux are you using?

 > and I no longer have any issues with LD_LIBRARY_PATH being called for.
 >
 > strange indeed.

Not really. Try this, at a command prompt:

$ export HELLO=Hi!
$ echo $HELLO
$ env <- shows all environment variables, you'll see HELLO there too

Now put this in a file, called hi.sh:

export HELLO=Hi!

Saved the file. Now interpret the file using source:

# unset HELLO <- remove the HELLO env var
# source hi.sh <- interpret the hi.sh script
# echo $HELLO <- Do you see Hi!? It worked

Now change the script, add the "shebang" to the beginning:

#!/bin/sh
export HELLO=Hi!

(save the 2-line file)

# chmod a+x hi.sh <- mark as executable
# unset HELLO
# ./hi.sh
# echo $HELLO <- Do you see Hi?!? No. You're not supposed to.

Here's the explanation:
https://stackoverflow.com/questions/16618071/can-i-export-a-variable-to-the-env
ironment-from-a-bash-script-without-sourcing-i#16619261

However, if you run another program or command from within that script (e.g.
hi.sh), it'll get the modified environmnet just fine. Add the following line to
the end of hi.sh:

echo $HELLO

Now when you run hi.sh:

# ./hi.sh
# Hi!
# echo $HELLO

So the copy of the environment that the script is using had the "HELLO" env var
set, but not the parent environment. And once the script is done, the copy of
the environment with HELLO set is gone.

This is all Unix stuff and really has nothing to do with Synchronet,
specifically.

                                            digital man

This Is Spinal Tap quote #7:
Nigel Tufnel: That's just nitpicking, isn't it?
Norco, CA WX: 60.2øF, 21.0% humidity, 0 mph SSW wind, 0.00 inches rain/24hrs
--- SBBSecho 3.03-Win32
* Origin: Vertrauen - [vert/cvs/bbs].synchro.net (1:103/705)

SOURCE: echomail via QWK@docsplace.org

Email questions or comments to sysop@ipingthereforeiam.com
All parts of this website painstakingly hand-crafted in the U.S.A.!
IPTIA BBS/MUD/Terminal/Game Server List, © 2025 IPTIA Consulting™.