Re: setting variables in tcsh temporarily

2004-06-15 Thread Matthew Seaman
On Tue, Jun 15, 2004 at 01:32:49AM +0200, Geert Hendrickx wrote:

 I have this simple question regarding the tcsh: 
 
 in /bin/sh (Bourne shell) I can assign a value to an environment variable for
 just one command, like this: 
 
 VARIABLE=value command
 
 e.g. DISPLAY=:0 xterm or CFLAGS=O2 make.  
 
 Can this be done with tcsh as well?  The only thing I can think of is this:

You need the env(1) command:

% env DISPLAY=:0 xterm

Syntax is just like the Bourne shell equivalent; just insert 'env' at
the beginning of the command line.

Cheers,

Matthew

-- 
Dr Matthew J Seaman MA, D.Phil.   26 The Paddocks
  Savill Way
PGP: http://www.infracaninophile.co.uk/pgpkey Marlow
Tel: +44 1628 476614  Bucks., SL7 1TH UK


pgpuWYwzPoG3L.pgp
Description: PGP signature


Re: setting variables in tcsh temporarily

2004-06-15 Thread Geert Hendrickx
 You need the env(1) command:
 
 % env DISPLAY=:0 xterm
 
 Syntax is just like the Bourne shell equivalent; just insert 'env' at
 the beginning of the command line.
 
   Cheers,
 
   Matthew


Very nice, thanks!  

GH
___
[EMAIL PROTECTED] mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to [EMAIL PROTECTED]


setting variables in tcsh temporarily

2004-06-14 Thread Geert Hendrickx
Hi, 

I have this simple question regarding the tcsh: 

in /bin/sh (Bourne shell) I can assign a value to an environment variable for
just one command, like this: 

VARIABLE=value command

e.g. DISPLAY=:0 xterm or CFLAGS=O2 make.  

Can this be done with tcsh as well?  The only thing I can think of is this:

( setenv VARIABLE value ; command )

thus invoking a subshell, because for example the multiline variant

setenv DISPLAY :0
xterm
unsetenv DISPLAY

forgets the (possible) original value of the variable.  

Thanks for any hints, this is the only Bourne-shell feature I'm missing in the
C-shell.  

GH
___
[EMAIL PROTECTED] mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to [EMAIL PROTECTED]