_Which_ shell do you use ? Is it really "bash" ? How did you configure it ?
-Michael
This is a discussion on bourne shell under uClinux - Embedded ; 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, ...
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
_Which_ shell do you use ? Is it really "bash" ? How did you configure it ?
-Michael
tns1 wrote:
> 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.
Different shells are reading different files from etc/ and $HOME/ for this
purpose. You should run "man"
JB
tns1 wrote:
> 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
This is 'sh', not bash on a Busybox distro. Does it expect to see a
system rc file somewhere?
tns1 wrote:
> 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
It looks like I am able to create global vars by exporting them from
/etc/profile
tns1 wrote:
> tns1 wrote:
>> 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
>
> It looks like I am able to create global vars by exporting them from
> /etc/profile
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.
> Global variables created in profile are present only
> when logged in,
What do you mean by "Global variables" ?
> so they are useless for autonomous (autolaunch)
> configurations like mine.
What do you mean by "autolaunch" ?
> I am just looking for a way to define the
> network settings in one place, yet have them available system-wide.
>
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
Michael Schnell wrote:
> > Global variables created in profile are present only
>> when logged in,
>
> What do you mean by "Global variables" ?
>
>> so they are useless for autonomous (autolaunch) configurations like mine.
>
> What do you mean by "autolaunch" ?
>
>> I am just looking for a way to define the network settings in one
>> place, yet have them available system-wide.
>>
>
> 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
Using the sourcing syntax was what I needed, thanks.