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

© 2005 The SCO Group, Inc. All rights reserved.
SCO OpenServer Release 6.0.0 -- 26 May 2005