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

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