bourne shell under uClinux

I am trying to get shell variables in the system rc file to be global for all shell scripts. The export command only seems to provide this for scripts run directly from the rc file.

Where/how are the system PATH, SHELL, HOME vars defined, since they are global.

thanks

Reply to
tns1
Loading thread data ...

_Which_ shell do you use ? Is it really "bash" ? How did you configure it ?

-Michael

Reply to
Michael Schnell

Different shells are reading different files from etc/ and $HOME/ for this purpose. You should run "man

Reply to
Juergen Beisert

This is 'sh', not bash on a Busybox distro. Does it expect to see a system rc file somewhere?

Reply to
tns1

It looks like I am able to create global vars by exporting them from /etc/profile

Reply to
tns1

Spoke too soon. Global variables created in profile are present only when logged in, so they are useless for autonomous (autolaunch) configurations like mine. I am just looking for a way to define the network settings in one place, yet have them available system-wide.

Reply to
tns1

What do you mean by "Global variables" ?

What do you mean by "autolaunch" ?

What do you mean by "in one place" ? What do you mean by "system-wide" ?

To provide some information "system-wide" it can be stored in a file and thus is is "in one place".

If multiple shells are started "export" variables only are copied to the shells' environments, if one is spawned by another. Shells also can be spawned by other programs (e.g. init or telnetd) independently from the shell tat interprets the start up script(s) (usually something like "rc").

Some shells look at one or more config file(s) that allow(s) (e.g.) for executing a script before a prompt is shown.

If your shell(s) are used to run scripts, you can simply start each script with "sourcing" (calling) a central standard script (e.g. ". /etc/setvars") ("." means "source": don't spawn another shell).

-Michael

Reply to
Michael Schnell

Using the sourcing syntax was what I needed, thanks.

Reply to
tns1

ElectronDepot website is not affiliated with any of the manufacturers or service providers discussed here. All logos and trade names are the property of their respective owners.