Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP
Path: utzoo!mnetor!uunet!husc6!cmcl2!rutgers!topaz.rutgers.edu!ron
From: ron@topaz.rutgers.edu (Ron Natalie)
Newsgroups: comp.unix.wizards,comp.unix.questions,comp.lang.c
Subject: Re: Help! How 2 get info from C to Unix script
Message-ID: <16827@topaz.rutgers.edu>
Date: Fri, 4-Dec-87 12:13:02 EST
Article-I.D.: topaz.16827
Posted: Fri Dec  4 12:13:02 1987
Date-Received: Wed, 9-Dec-87 04:42:38 EST
References: <1569@ssc-vax.UUCP>
Organization: Rutgers Univ., New Brunswick, N.J.
Lines: 22
Keywords: C, Unix script, need help
Xref: mnetor comp.unix.wizards:5815 comp.unix.questions:5198 comp.lang.c:5735

The way of making the output a command into an argument for something
in the shell is to use the accents to quote the command to run.

Suppose you have a program then that returns "foo.c" on it's standard
output:

    $ pick_prog
    foo.c

Using the accents, you can pass that as an argument to other programs:

    $ ls -l `pick_prog`
    total 1
    -rw-rw-r--  1 ron           104 Nov 26 23:00 foo.c

And likewise, you can use this to set a variable:

    $ FILE=`pick_prog`
    $ echo $FILE
    foo.c

-Ron