It is currently Fri, 19 Jan 2018 09:56:09 GMT



 
Author Message
 shell redirection
When I am in a Bourne shell from login. I can type ksh93 to change to a Korn
Shell. However it does not seem to be reading my .kshrc file. Instead it is
still looking at my .shrc file. How do I tell it when I type ksh93 at a
prompt to look at my .kshrc file?

Brendhan



 Fri, 27 May 2005 00:22:16 GMT   
 shell redirection

How is your ENV variable set before calling ksh93?

Umberto



 Fri, 27 May 2005 06:25:14 GMT   
 shell redirection

news:at0gol$v59m8$1@ID-163428.news.dfncis.de...
 The ENV varible in which file ?

Brendhan



 Fri, 27 May 2005 07:32:14 GMT   
 shell redirection

Not in a file -- in your environment.

Try:
  echo $ENV



 Fri, 27 May 2005 07:34:06 GMT   
 shell redirection

news:44of7w5bm9.fsf@be-well.ilk.org...

Results as follows from login shells:
brendhan@TheBaron>$ echo $ENV
/home/brendhan/.shrc      <--- Bourne Shell
[bhorne@TheBaron:bhorne, 06:36 PM,Sun Dec 08]>$ echo $ENV

[bhorne@TheBaron:bhorne, 06:36 PM,Sun Dec 08]>$  The BASH result

TheBaron darcon $echo $ENV

TheBaron darcon $ The Z shell result

louis@TheBaron /home/louis ->echo $ENV
ENV: Undefined variable.
louis@TheBaron /home/louis ->The C shell

[6:39pm] TheBaron [/root]>echo $ENV
ENV: Undefined variable.
[6:39pm] TheBaron [/root]>The TC shell

James@TheBaron:/home/James>echo $ENV

James@TheBaron:/home/James>  The Korn shell



 Fri, 27 May 2005 07:41:47 GMT   
 shell redirection

Well, that's clear.
When you login, your Bourne Shell sets ENV variable to
/home/brendhan/.shrc
So, when you call ksh93 from Bourne Shell, Korn Shell loads that file,
because it inherits ENV value from its parent process, instead of its
default one.

Simply unset ENV variable before calling the Korn Shell:

...after login Bourne Shell is loaded...
$ echo $ENV
/home/brendhan/.shrc
$ unset ENV
$ echo $ENV

...ENV variable is unset. Now you launch Korn Shell
$ ksh93
...should load .kshrc now.

Of course, you can change your login shell to Korn Shell using chsh
(check for the right shell path with /etc/shells, it should be
/usr/local/bin/ksh93, IIRC).

BTW, a login Bourne or Korn shell loads .profile too (but ONLY at
login time), if you have it, check its contents.
Beware that X Window graphic shells are not login one, so .profile is
not loaded. Use xterm -ls if you need to force a login shell, which
loads .profile too.
All login Bourne or Korn shells load /etc/profile for systemwide
settings before user-specific profiles, so check its contents too.

That should be all... :-)

Umberto



 Fri, 27 May 2005 09:57:15 GMT   
 shell redirection
I think I got it. On login to Bourne it reads .profile first. If I do a
ksh93 at prompt it reads .shrc. I don't have to worry about having a .shrc
set for Bourne because it is reading .profile.  ( Umberto does it again )
So I added this line to my .shrc
ENV=~/.kshrc
export ENV

And I have a ,kshrc with my prompt settings in it.
All is wonderful with the world. So far> I can see I am going to have a few
more problems ahead espcially if I am coming from a BASH login. Okay I will
tackle that when I get to it.

Thanks everyone again,

Brendhan



 Fri, 27 May 2005 12:44:57 GMT   
 
   [ 7 post ] 

Similar Threads

1. shell redirection

2. shell redirection

3. z-shell redirection of ls

4. shell redirection

5. k shell redirection in system()

6. Bourne shell redirection - Pls help

7. Message redirection to shell in x?

8. Remote shell and redirection at speed 19200


 
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group.
Designed by ST Software