Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP
Posting-Version: version B 2.10.3 4.3bsd-beta 6/6/85; site vilya.UUCP
Path: utzoo!watmath!clyde!cbosgd!ihnp4!houxm!whuxl!whuxlm!vilya!am
From: am@vilya.UUCP (MALEK)
Newsgroups: net.unix-wizards
Subject: Re: am I in background?
Message-ID: <247@vilya.UUCP>
Date: Wed, 6-Nov-85 15:39:24 EST
Article-I.D.: vilya.247
Posted: Wed Nov 6 15:39:24 1985
Date-Received: Fri, 8-Nov-85 21:55:17 EST
References: <129@wgivax.UUCP>
Organization: AT&T Bell Labs, Parsippany
Lines: 23
> On a 4.2 system, is there any reliable way in which a c-program can determine
> .......... if it is run directly from a terminal.
> I am trying to implement an automatic audit trail mechanism which allows users
> to enter optional comments at the beginning of major system utilities (sort,
> awk, sed, etc.) The problem is that many of our users frequently use pipes,
> file redirection, and background processing, thus making the task of knowing
> when to query for a comment more complex. Mike O'Shea
The best way top solve your problem is to have "aud" (or some other name).
code for "aud":
if test "$#" = 0
then
echo YOUR SYNTAX MESSAGE
exit 1
fi
# now run the command by exec or sh or ksh......
exec $*
This is rather portable and allows the user to turn on logging when desired.
To force logging, you probably need to add lines or to front end each
command separately.
--
Avi Malek @ATT Bell Labs Parsippany, NJ