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

Concatenation

Two words or lists can be concatenated, or joined together, using the ``^'' (circumflex or caret) character.

Lists can only be concatenated if they both contain the same number of elements, or if one of them only contains one element or is empty, as illustrated by the following examples:

a b a^b
w x wx
w (x y z) (wx wy wz)
(w x y) (a b c) (wa xb yc)
(w x y) ( ) (w x y)
(w x y) (a b) illegal


NOTE: There should not be any spaces around the ``^'' character.

Several concatenations can be included in one expression, as in:

   s.^(in proc out)^.main.^(c h s)
which evaluates to:
   (s.in.main.c s.proc.main.h s.out.main.s)

Deskshell allows circumflexes to be omitted when the context makes it unambiguous. For example, $file^.c can be written as $file.c instead.

See also:


Next topic: Command terminators
Previous topic: List substitution

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