Yossi Kreinin <[email protected]> wrote:
Peter da Silva wrote:
On Jan 10, 2007, at 10:10 AM, Yossi Kreinin wrote:

> setenv A B
> echo $A
B
> env A= echo $A
B
> env A=X echo $A
B


This example does not demonstrate what you believe it demonstrates.



A second answer which is not an answer.

An answer looks like this:

"echo is a built-in command, bk is not, so it will work with bk".

There. Was it that hard?

Apparently very easy, but entirely wrong alas.

Here's a clue:

% tcsh
$ setenv A B
$ /bin/echo $A
B
$ env A=X /bin/echo $A
B
$ exit
%

/bin/echo is not a built in command.

A more direct clue is that variable expansion is performed before the command is executed.

Really, I didn't mean to be harsh, but you will get a lot more out of the unix shell if you at least take 30 mins to understand the basics. My guess is you'll get that 30 mins back quite quickly in terms of being able to use the shell to your advantage (whatever shell you're stuck with).

Cheers,

Martin.

Reply via email to