DOC HOME SITE MAP MAN PAGES GNU INFO SEARCH PRINT BOOK
 
Writing Deskshell commands

Variable overriding

A local variable can be given a value for the duration of one command by prefixing the command with the variable assignment. For example:

   var=2
   var=1 for_info 'var=' $var
   for_info 'var=' $var
will first display the value of var as ``1'', and then as ``2''.

If the command is a function call, then the new value applies for the duration of the function call, after which the variable reverts to its previous value. It makes no difference whether or not the function also alters the value.


Next topic: How environments are inherited
Previous topic: Global variables

© 2003 Caldera International, Inc. All rights reserved.
SCO OpenServer Release 5.0.7 -- 11 February 2003