* Question about the KSH
@ 1996-10-07 4:00 Patrick
1996-10-07 4:00 ` John R. Campbell
0 siblings, 1 reply; 2+ messages in thread
From: Patrick @ 1996-10-07 4:00 UTC (permalink / raw)
Hi,
When I start a script, normally a KSH is executed...
But how do I prevent this...
why?
I want to start a script with some environment settings in there.
But when I start this script, it load these setting in the
second ksh but not in current ksh...
so, can anyone tell how to do this?
Tnx, Patrick
pgh@rijnhaave.nl
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: Question about the KSH
1996-10-07 4:00 Question about the KSH Patrick
@ 1996-10-07 4:00 ` John R. Campbell
0 siblings, 0 replies; 2+ messages in thread
From: John R. Campbell @ 1996-10-07 4:00 UTC (permalink / raw)
On Mon, 07 Oct 1996 10:06:03 -0700, Patrick <pgh@rijnhaave.nl> wrote:
>Hi,
>
>When I start a script, normally a KSH is executed...
>But how do I prevent this...
>
>why?
It is Unix tradition that a shell script runs in a sub-shell.
You can control what kind of shell interprets the script by
placing a
#! /bin/sh
(for instance) at the left margin of the first line of the file.
>I want to start a script with some environment settings in there.
>But when I start this script, it load these setting in the
>second ksh but not in current ksh...
Unlike DOS, each sub-shell gets a local copy of the parent's
exported environment and may manipulate it locally; Since a
regular executable program has the same thing happen, and it
is dangerous to propagate a change back to the parent process,
this environment is _not_ returned.
There is some logic in this.
A dirty trick I use is to generate a file of environment variables
and "source" it in a "current" shell using the following:
. ./setvars
This is how the .profile and .kshrc files are sucked in...
UNIX *is* User-Friendly; It's just picky about who it's friends are.
--
John R. Campbell, Speaker to Machines, Resident Heckler soup@jtan.com
"As a SysAdmin, yes, I CAN read your e-mail, but I DON'T get that bored!"-me
Disclaimer: I'm just a consultant at the bottom of the food chain, so,
if you're thinking I speak for anyone but myself, you must
have more lawyers than sense.
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~1996-10-07 4:00 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
1996-10-07 4:00 Question about the KSH Patrick
1996-10-07 4:00 ` John R. Campbell
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox