1833899 Members
2053 Online
110063 Solutions
New Discussion

export problem

 
jimmy_39
Advisor

export problem

hi guys

I have a problem. I want to do a [script] that launched set the DISPLAY = vt100, but, if I effect the command [set] after have launched the [script] I see that the variable $DISPLAY doesn't have the value vt100.does a way exist for do it?
10 REPLIES 10
T G Manikandan
Honored Contributor

Re: export problem

DISPLAY should be like


DISPLAY=:0.0
export DISPLAY
TERM=vt100
export TERM
jimmy_39
Advisor

Re: export problem

ok
I have done as but when the [script] finishes the value don't result assigned.

example


vi jimmy
TERM=vt100
export TERM
:wq

chmod 777 jimmy
./jimmy

ora digito SET
PS2='> '
PS3='#? '
PS4='+ '
PWD=/tmp
RANDOM=18592
SECONDS=18464
SHELL=/sbin/sh
TERM=vt220
TMOUT=0
TZ=MET-1METDST

help me
Geoff Wild
Honored Contributor

Re: export problem

What are you using as a terminal emulator?

This works for me:

# echo $TERM
xterm

export TERM=vt100

# echo $TERM
vt100


Rgds...Geoff
Proverbs 3:5,6 Trust in the Lord with all your heart and lean not on your own understanding; in all your ways acknowledge him, and he will make all your paths straight.
Graham Cameron_1
Honored Contributor

Re: export problem

As per above post, DISPLAY is used by X-windows, and is usually something like 10.85.114.117:0.0.
Maybe you mean TERM=vt100 ??
Anyway, you can export an environment variable in more than one way.
eg
--
"TERM=vt100 command"
--
will run command, set the TERM variable and then call command. When command has finished, TERM will be unset.
--
export TERM=vt100
command
--
does the same, but TERM remains set subsequently.
--
-- Graham
Computers make it easier to do a lot of things, but most of the things they make it easier to do don't need to be done.
Chris Wilshaw
Honored Contributor

Re: export problem

To set this by running a script, you need to use

. ./jimmy
Mark Grant
Honored Contributor

Re: export problem

If I understand you correctly you are trying to set your DISPLAY by running a script. This will not work. You need to set the DISPLAY in the current shell or the parent shell. When you run your script, you are starting a new shell, setting the DISPLAY variable. This sets the variable in the scripts environment, not yours. There are two solution. The first is to "export DISPLAY=ip address:0" in your .profile or have a file containing only "export DISPLAY=ipaddress:0" called for example "setdisplay" and going ". setdisplay". This special command will put the variable in your current environment.

Hope tis helps
Never preceed any demonstration with anything more predictive than "watch this"
Graham Cameron_1
Honored Contributor

Re: export problem

Just saw your reply.
In your example, you need " . ./jimmy"
-- Graham
Computers make it easier to do a lot of things, but most of the things they make it easier to do don't need to be done.
jimmy_39
Advisor

Re: export problem

ok


the problem is in the script


###vi jimmy


TERM=vt100
export TERM


:wq



###chmod 777 jimmy

###./jimmy


###set

EDITOR=vi
ERASE=^H
ERRNO=0
FCEDIT=/usr/bin/ed
HISTFILE=/.sh_history
HOME=/
IFS='
'
LINENO=1
LOGNAME=root
MAIL=/var/mail/root
MAILCHECK=600
MANPATH=/usr/share/man/%L:/usr/share/man:/usr/contrib/man/%L:/usr/contrib/man:/n
OLDPWD=/
OPTARG
OPTIND=1
PATH=/usr/sbin:/usr/bin:/usr/ccs/bin:/usr/contrib/bin:/opt/hparray/bin:/opt/nett
PPID=23245
PS1='xxx:$PWD\#'
PS2='> '
PS3='#? '
PS4='+ '
PWD=/tmp
RANDOM=18592
SECONDS=18464
SHELL=/sbin/sh
TERM=vt220
TMOUT=0
TZ=MET-1METDST
_=s




thank
T G Manikandan
Honored Contributor

Re: export problem

. ./jimmy

dot space dot slash jimmy
Mark Grant
Honored Contributor

Re: export problem

Jimmy,

please note several posts above!

You need to run it ". jimmy". Notice the period/full stop at the start
Never preceed any demonstration with anything more predictive than "watch this"