> -----Original Message-----
> From: Postman Pat [mailto:[EMAIL PROTECTED]]
> Sent: Friday, May 17, 2002 2:27 AM
> To: [EMAIL PROTECTED]
> Subject: Test how we were executed
> 
> 
> Greetings,
> I want to write a script that will check to see if it was called from 
> another script, if not it will display a message saying for 
> instance this 
> script is meant to be called from other script & not run 
> interactively for 
> instance otherwise if called from a script will do it's 
> intended purpose...
> 
> Is there a way that I can actually get this working properly?

Not sure exactly what you're trying to prevent here. Are you saying
that your script X should only be invoked from another specific
script Y? And when you say "called by", do you mean fork/exec, or
some Perl mechanism (do/require/use).

Or do you mean script X should not be invoked from an interactive 
shell?

If your script is expecting to read some input from STDIN and you
don't want it to just sit there waiting for terminal input, you can
use the -t operator to see if STDIN is a terminal:

   die "Don't run me interactively\n" if -t STDIN;

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to