What is a good way to do general execs?

Martin Weitzel martin at mwtech.UUCP
Sat Jun 9 04:43:59 AEST 1990


In article <438 at mtndew.UUCP> friedl at mtndew.UUCP (Stephen J. Friedl) writes:
[needs to exec a user supplied program, but has to avoid "system"]
>     Execv works great if I'm running a binary, but it doesn't
>like to run shell scripts directly (this is Sys V).  To get around
>this I try the following:

Use "execvp". The "p" stands not only for pathname search, but also
will invoke a shell if the supplied program is in reality a script.
Eventually you may want to set PATH with `putenv' to make execvp
search the desired directories (only).

Small flame concerning choice of groups: How about a *first* try
with comp.unix.questions - you can have allways a second try with
c.u.w, but experience shows you may well receive the attention
of a wizard in c.u.q. At most make a crosspost but leave followups
to c.u.q. I felt tempted to redirect followups, but as I don't
appreciate to have threads pop up "out of nothing" I left it here.
-- 
Martin Weitzel, email: martin at mwtech.UUCP, voice: 49-(0)6151-6 56 83



More information about the Comp.unix.wizards mailing list