[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [microblaze-uclinux] setenv in uClinux



Leonid wrote:
I basically want to be able to run u-boot HUSH script in the Linux
shell. U-boot has "setenv" commands with effect, similar to that of bash
"export" - it defines global variables, visible from everywhere:

export makes environment variables visible to *child* processes of the current process - not the parent process.

setenv ipaddr 1.2.3.4
echo $ipaddr
1.2.3.4


I thought I'll write small application "setenv" which will be setting
environment variables... Do you have a better idea?

In bash you can use "source"

*** ipaddr.sh ***
export ipaddr 1.2.3.4


# source ipaddr.sh
# echo $ipaddr
1.2.3.4

I'm not sure which shells support source.

Another option is to put in /etc/rc, that gets interpreted on startup and any environment variables placed there will be visible to the login shell

Finally you have the option of using temp files, in /var for example.

Regards,

John
___________________________
microblaze-uclinux mailing list
microblaze-uclinux@xxxxxxxxxxxxxx
Project Home Page : http://www.itee.uq.edu.au/~jwilliams/mblaze-uclinux
Mailing List Archive : http://www.itee.uq.edu.au/~listarch/microblaze-uclinux/