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

Variable substitutions

The value of a variable can be substituted into a script with:

   $name
So, for example, $editors will have the value:
   vi xedit ed
You can find the number of elements in a list with variable. For example:
   elements=$#editors
sets elements to ``3''.

Note that:

   var=()
sets var to a list with no elements, so $#var is ``0'', whereas:
   var=''
sets var to an empty string, so $#var is ``1''.
Next topic: Subsets
Previous topic: Using variables

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