1855738 Members
2017 Online
104103 Solutions
New Discussion

Re: cde X11 environment

 
eric stewart
Frequent Advisor

cde X11 environment

Here is my question of the day.
I am using the cde environment.
I have set up the .dtprofile to execute my .profile which has PS1 and PS2 defined in it.
I have a cd as the last line in the .profile.
Why does the prompt not show the current directory? It just shows the generic $ prompt.

Here is the end of the .profile.

58 export PS1='${PWD}
59 >' # two line directory and prompt on second line
60 export PS2='${PWD}
61 >' # two line directory and prompt on second line
62 # EXINIT='set nonu'
63 cd /prd/preclinical/`whoami`

Here is the .dt/startlog

1 --- Tue Oct 10 13:46:49 EDT 2000
2 --- /usr/dt/bin/Xsession starting...
3 --- Xsession started by dtlogin
4 --- sourcing /home/rmicklo1/.dtprofile...
5 --- sourcing /usr/dt/config/Xsession.d/0010.dtpaths...
6 --- sourcing /usr/dt/config/Xsession.d/0020.dtims...
7 --- sourcing /etc/dt/config/Xsession.d/0029.setCommunicatorEnv...
8 --- sourcing /usr/dt/config/Xsession.d/0030.dttmpdir...
9 --- sourcing /usr/dt/config/Xsession.d/0040.xmbind...
10 --- sourcing /usr/dt/config/Xsession.d/0060.srcsysenv...
11 --- starting /usr/dt/bin/dthello -file /home/rmicklo1/.dt/paminfo_172.30.14.169:0 -file /etc/copyright &
12 --- starting /usr/dt/bin/dtsearchpath -ksh
13 /usr/dt/bin/dthello: display 172.30.14.169:0.0 doesn't know font -dt-interface system-medium-r-normal-m*-*-*-*-*-*-*-*-*
14 --- starting /usr/dt/bin/dtappgather &
15 --- execing /usr/dt/bin/dtsession using /home/rmicklo1/.profile...
16 /usr/dt/bin/dthello: display 172.30.14.169:0.0 doesn't know font fixed
17 executing .profile
TIA
Good help is easy to find within forums
9 REPLIES 9
James R. Ferguson
Acclaimed Contributor

Re: cde X11 environment

Eric:

Is it a typo, or did you not close the prompt strings with a "'" ???

...JRF...
rajsri
Frequent Advisor

Re: cde X11 environment

you can try PS1=$PWD
Alex Glennie
Honored Contributor

Re: cde X11 environment

Because its never getting run (the .profile that is ) ?

Are you by any chance running your script via a dtterm , hpterm or xterm ? if so try the following :

start dtterm -ls , does it work ?

If yes look at man dtterm loginShell resource : set it to True in $HOME/.Xdefaults file too force this behaviour to be default.
Lasse Knudsen
Esteemed Contributor

Re: cde X11 environment

Hi,

'dtterm' is not run as a login shell as default and it will not run .profile.

You need to either export PS1 and PS2 variables or put PS1 and 2 assignments into a .kshrc file and point your ENV variable towards this.

In a world without fences - who needs Gates ?
Manuel Plaza
Regular Advisor

Re: cde X11 environment

Hi,

You must copy your .profile to .kshrc or .cshrc ... depending if your shell is ksh, csh ...
And in your .profile only is necessary the following line:
. $HOME/.kshrc (or .cshrc ... )

Regards
CHRIS_ANORUO
Honored Contributor

Re: cde X11 environment

Just update the PS1 line with "export PS1=$(whoami) '[${PWD##*/}]'" and put a comment on the PS2 for a try.
When We Seek To Discover The Best In Others, We Somehow Bring Out The Best In Ourselves.
CHRIS_ANORUO
Honored Contributor

Re: cde X11 environment

Just update the PS1 line with "export PS1=$(whoami) '[${PWD##*/}]'" and put a comment on the PS2 for a try.
Then award your marks!
When We Seek To Discover The Best In Others, We Somehow Bring Out The Best In Ourselves.
eric stewart
Frequent Advisor

Re: cde X11 environment

Here is some answers and another question.
When I logged in this morning it all worked.
By the way when I read your reply I forget that back slashed do get translated properly. The end of the PS1 nad PS2 lines have a backslash to continue on the next line.
Alex: I am not running the script via dtterm hpterm or term that I control and know about.
The dtterm -ls worked.
SO I addded the .Xdefaults with the loginshell true. Now the first window opened under Exceed performs the .profile and the prompt is what PS1 is set.
But. (That bad word). Before I was able to execute SAS and it open up several Xwindows to run in. When I added the .Xdefault SAS will not open the Xwindows. Also, another local application gives me this erro message:
ERROR: Cannot open X display. Check display name/server access authorization.
Can you again help?
TIA
Good help is easy to find within forums
eric stewart
Frequent Advisor

Re: cde X11 environment

Well, I got everything working now.
This is what I think is happening.
When exceed starts the first dtterm session and you uncomment out the last line of the .dtprofile, it executes your .profile for for any new dtterm session but not the first. If you add the .Xdefaults per the .dtprofile then it gets executed in the first session. It then gets re-executed again. But at this point the DT parameter is unset. In my .profile when the DT parameter was not set I executed the DISPLAY=mydisplay:0.0, as also shown in the .dtprofile. THis is what messed up any starting of the X windows applications. I just removed the DISPLAY line of code from my .profile and it all works now.
If I am wrong anyone may feel free to correct and educate.
Thanks for the replies. Will give points later.
Good help is easy to find within forums