tobold.org

correct • elegant • free

△ comp.unix.shell △

◅ add quotas within a shell script

add quotas within a shell script ▻

Bourne Shell question

In article <8ce468$aoj$1@nnrp1.deja.com>,  <barunachalam@my-deja.com> wrote:
>I need to invoke a C function from a bourne shell script.

Unless it's called `main()', you can't :-).

You need to wrap your function into a complete program.

>                                                           This C function
>has parameters passed by reference (char *).  The contents of this parameter
>get changed within the function.  What is the syntax of passing an argument
>by reference in the shell script.

Again, you can't.

Your program needs to collect its input---perhaps from command line
arguments, perhaps from standard input---and write its output to
standard output.  From there, it can be picked up by the shell using
backquotes, etc.

Tim.
--
Tim Goodwin   | "If you don't know what closures are, you probably don't
Leicester, UK | want to know what closures are." -- Larry Wall

Original headers:

From: tjg@star.le.ac.uk (Tim Goodwin)
Newsgroups: comp.unix.shell
Subject: Re: Bourne Shell question
Date: 5 Apr 2000 12:02:32 +0100
Message-ID: <8cf6gu$rgp$1@ltpcg.star.le.ac.uk>
References: <8ce468$aoj$1@nnrp1.deja.com>

△ comp.unix.shell △

◅ add quotas within a shell script

add quotas within a shell script ▻