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 derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Help with aliases and subshells in ksh

Status
Not open for further replies.

jouell

MIS
Joined
Nov 19, 2002
Messages
304
Location
US
Hi!


If I do this:

alias suo='su - oracle -c ". /.aliases; exec $SHELL"'

and then run my new alias, only the varaibles I export are brought over, not the aliases....Why is that?

Thanks!
-John



Please see:
 
Replace this:
-c ". /.aliases
By this:
-c "./.aliases

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ181-2886
 
OOps, sorry, disregard my previous post, I meant this:
Replace this:
-c ". /.aliases
By this:
-c ". ./.aliases

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ181-2886
 
Hmmm, I get:

ksh: ./.jo: not found


The file lives in / and is named .jo

Am I doing something wrong?


Thanks!
-john

 
man ksh said:
Exported aliases remain in effect for scripts
invoked by name, but must be reinitialized for separate invocations of the
shell.
hth
 
Check out the environment variable called "ENV" for ksh.

It can be used to "export" functions and aliases from a running korn shell process to an invoked korn subshell...

HTH,

p5wizard
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top