Google Groups Home
Help | Sign in
Message from discussion Sourcing file in the same shell using a command and csh
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
Stephane CHAZELAS  
View profile
 More options May 9, 12:07 pm
Newsgroups: comp.unix.shell
From: Stephane CHAZELAS <this.addr...@is.invalid>
Date: Fri, 9 May 2008 18:07:42 +0200 (CEST)
Local: Fri, May 9 2008 12:07 pm
Subject: Re: Sourcing file in the same shell using a command and csh
2008-05-9, 08:57(-07), amiro...@googlemail.com:
> I forgot to mention that I use a csh on a RHEL 4.6 machine.

> On 9 Mai, 17:07, Stephane CHAZELAS <this.addr...@is.invalid> wrote:
>> 2008-05-9, 07:25(-07), amiro...@googlemail.com:
>> [...]

>> If you're shell is csh compatible, use

>> source executable-file

> I don't want to use the "source" command from the prompt. I would like
> to just start an executable file and this should set some environment
> variables and modify my $PATH in the running shell.

[...]

You can't. The environment is a list of strings that is passed
as an argument to the execve() system call, so that some data of
the original command can survive into the new execed command.

If you want your shell memory to be updated, it must be
something initiated by your shell. Typically a process can't
alter the memory of another process, that would cause all sorts
of reliability and security issues.

What you can do is something like:

eval `executable`

and manage to have "executable" display some csh code. But the
fact that csh has got a number of issues wrt quoting is going to
make it difficult to do reliably.

Do you have to use csh?

--
Stéphane


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.

Create a group - Google Groups - Google Home - Terms of Service - Privacy Policy
©2008 Google