Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP
Path: utzoo!mnetor!uunet!husc6!bloom-beacon!think!barmar
From: barmar@think.COM (Barry Margolin)
Newsgroups: comp.unix.wizards,comp.unix.questions,comp.lang.c
Subject: Re: Help! How 2 get info from C to Unix script
Message-ID: <12702@think.UUCP>
Date: Thu, 3-Dec-87 20:05:41 EST
Article-I.D.: think.12702
Posted: Thu Dec  3 20:05:41 1987
Date-Received: Tue, 8-Dec-87 00:53:32 EST
References: <1569@ssc-vax.UUCP>
Sender: usenet@think.UUCP
Reply-To: barmar@sauron.UUCP (Barry Margolin)
Organization: Thinking Machines Corporation, Cambridge, MA
Lines: 22
Keywords: C, Unix script, need help
Xref: mnetor comp.unix.wizards:5788 comp.unix.questions:5188 comp.lang.c:5718

In article <1569@ssc-vax.UUCP> bact@ssc-vax.UUCP (Archie A. Auxter) writes:
>  Is there a way
>that I can call my program within a Unix script and set a variable in the Unix script
>to equal the filename the user selected?  What I would like to do is:

>FILE_PICKED=(call C program here, have it return filename)

The way to do this is to have your program print the filenames to
stdout.  You can then pipe the output into the command line using
`command line`, e.g.

FILE_PICKED=`program args`

Note that since this redirects stdout, when your program interacts
with the user it will have to open /etc/tty directly, not use stdout.

---
Barry Margolin
Thinking Machines Corp.

barmar@think.com
seismo!think!barmar