setting variables in tcsh temporarily

Matthew Seaman m.seaman at infracaninophile.co.uk
Tue Jun 15 01:05:37 PDT 2004


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
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 187 bytes
Desc: not available
Url : http://lists.freebsd.org/pipermail/freebsd-questions/attachments/20040615/a5ca4f97/attachment.bin


More information about the freebsd-questions mailing list