Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Wanet Telecoms Ltd on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

.kshrc on Red Hat Enterprise-3.x

Status
Not open for further replies.

ernieah

Programmer
Oct 27, 2002
42
US
(1) I can't get my .kshrc file to execute "automatically"
whenever I start a new xterm window. I can tell, since both
my own customized prompt and my aliases, do not occur, until
I execute my .kshrc via the command line.
This all is after\since our NEW upgrade to Red Hat enterprise 3.x.

(2) Previously, with Red Hat 7.x, I had my own extensive
(many entries) .profile file (in my own home directory), and set
the $ENV variable there, correctly, to point to my own .kshrc,
which then exected "automatically" as usual.

But with Red Hat Enterprise, I have only been able to use
the $DISPLAY varaible in my own .profile, else I get a
xinit-DISPLAY error (Can't connect, etc.) whenever I have
more than that one line in my .profile, and try to logon.

Any other entries in my .profile give me the logon
failure (above).

Therefore, I can't "set" my $ENV to point to my own .kshrc
file, since, so far, I can ONLY put the one, single DISPLAY
line in my .profile (I HAVE to have the DISPLAY line,
or I won't be able to "see" my work.)

(3) Why can't I have more-than-one entry in my own .profile file?

(4) echo $ENV seems to point, correctly, to my .kshrc file,
even though I do NOT have a $ENV in my .profile
(since it has ONLY one line). So SOMEWHERE, $ENV
HAS been "set", but NOT in my own .profile; and,
as I said, my .kshrc does NOT execute, except via manually

via the commnd line.

End-of-memo: Best to you..from ernieah.
I don't sell books, or work for any
publisher or computer company.
 
=================================================
(1) Yes. my .kshrc (in my home directory) is executable, and
every time I start a new term-window. I HAVE to execute my
.kshrc, manually, on the command-line, in that window:
". ./.kshrc <enter>" for its provisions to become effective in that window.

Once I execute my .kshrc, manually, in a window, then I get the benefit of it in that window only.

(2) As I mentioned above, if I echo my $ENV, then I get a desired answer of $HOME/.kshrc, or ~/.kshrc, BUT I then do NOT get "automatic" execution of .kshrc for any window I start, at the time I start it. Instead I HAVE to MANUALLY execute my .kshrc in any new window.

(3) I DON'T know HOW my $ENV got set to $HOME/.kshrc, since I could NOT set to there myself on my .profile file, since the latter (.profile) hangs crashes my session ("solid"), with a DISPLAY error, if I have more than one line on my .profile ("export DISPLAY=<distant-workstation>:0.0"). Any 2nd. line (eg, "export ENV=$HOME/.kshrc") causes the session to prompty crash immediatly AFTER successful logon with the DISPLAY error.

(3) It was my impressions that IF my $ENV variable was set, correctly, to .kshrc(regardless of who, or what, had "set" the $ENV value), then, from then on, whenever I start any new xterm window, my .kshrc WOULD be "in effect" for that new window without my having to execute my .kshrc "manually".

(4) Something, somewhere, is "setting" my $ENV variable, correctly, but WHAT? Is there something the sys-admin\superuser has done to "set" it? And, since it HAS been "set" (somehow) why doesn't it become effective for any new window I start?

(My sys-admin doesn't like to be bothered, apparently, by all these "trivial" questions from an "ordinary" user, or I wouldn't be asking these questions on a public forum.)

(5) Why did my own .profile work OK in RedHat 7.x, but the same one does NOT work (except for the FIRST, and ONLY line) in RedHat Enterprise 3,x?

Thanks again.







End-of-memo: Best to you..from ernieah.
I don't sell books, or work for any
publisher or computer company.
 

Your windows my not be starting as login shells.

Most unix shells are written so that, if their argv[0] (the name the were instantiated as) has a "-" is the first character, they recognize that they were spawned (usually by init) as a login shell and exhibit different behavior than if they were simply run as the real name:

foxtrot(~)$ ps -f
UID PID PPID C STIME TTY TIME CMD
brunson 16412 16410 11 09:01 pts/0 00:00:00 -bash
brunson 16529 16412 0 09:01 pts/0 00:00:00 ps -f

I have to start xterms with the '-ls' argument to get them to exec() bash with argv[0] having the leading "-".

From one of your open windows try running 'xterm' then 'xterm -ls'. Does the second source your .kshrc?

 
To: ericbrunson,
(and anybody else who's interested)

from: erniah..
03-May-2004

(1) Thanks for your, obviosly, well thought-out answer.
I am having trouble "relating" to your answer, beause
I ("myself") don't use "xterm", "DIRECTLY", in starting
my "xterm" windows, but, instead, I start my "xterm"
windows by mouse-clicking on an icon on my "gnome" window
manager taskbar, along the bottom of the screen. "Gnome"
starts my 'xterm" windows for me.

Therefore, I am NOT sure how to apply what you said to my starting MY "xterm" windows by mouse-clicking on the "gnome" task-bar icon.. (I have, in the past, experimentally. used an "xterm" command to start my "xterm" windows, but usually I let "gnoem" start them for me.)

And, as I mentioned above. with RH-7.x I always got the "benefit" of my .kshrc file whenever I started a new window using the "gnome" icon on ther task-bar, without any effort by me - because my $ENV environment was "set" to $HOME/.kshrc (which it still is 'set" to).

But, MERELY after the "upgrade" from RH-&.x to RH-Enterprise 3.x, now I DON'T get the "benefit" of my .kshrc file
at the start of a new window via a mouse-click on the "knome" task-bar icon for a new "terminal" window.

I don't know what else to do, since my $ENV is already 'set" to $HOME/.kshrc

End-of-memo: Best to you..from ernieah.
I don't sell books, or work for any
publisher or computer company.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top