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

Command substitution

Many Deskshell and UNIX commands perform an action and print a result. You can trap the output of such a command, and use it in a Deskshell script, with the `{...} construction.

The text output from the command is split into a list of strings at the character specified in $ifs(1), or the characters space, tab or newline if ifs is unset.

For example:

   size=`{ls -s $1}
assigns the string representing the size and name of the file $1 to the variable size.

See also:


Next topic: List substitution
Previous topic: Redirections

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