SPUG: exec question

Dan Ebert mathin at mathin.com
Fri Feb 11 11:32:55 PST 2005


Tim,

I tried out your solution and it is working fine.  Thanks for the help.
My understanding of what exec did was wrong ... which is what led to my
confusion.

I appreciate the help!

Dan.
----------------------------------------------------------
Immigration is the sincerest form of flattery.
	- Unknown
----------------------------------------------------------


On Fri, 11 Feb 2005, Tim Maher wrote:

> On Fri, Feb 11, 2005 at 10:10:15AM -0800, Ben Reser wrote:
> >
> > Anyway, from a security standpoint, don't ever do stuff like
> > what Tim showed you above. If you're passing arguments, then
> > you have to worry about those arguments having shell meta
> > characters in them...
> > Ben Reser <ben at reser.org>
>
> Ben,
>
> Regarding the difference in interpretation between the single-argument
> vs. multi-argument version of system, in the example I showed,
> metacharacter interpretation was /desired/, which is precisely why
> I showed the single-argument version.
>
> The metacharacters that needed interpretation included the ">"
> for output redirection, which I thought the original poster might
> need, and the "&" for background execution, which he definitely
> needs if he wants his script not to wait for the shell command to
> exit before continuing (unless he wants to do the fork/exec himself).
>
> Your statement "don't ever do stuff like what Tim showed you" is
> really uncalled for, and may discourage people from using
> features that can benefit them!
>
> There's no need to be afraid of the shell if you take appropriate
> precautions, which comes down to quoting funny characters that you
> want taken literally.
>
> See http://www.TeachMeUnix.com/quoting.html for a detailed
> discussion of the proper use of shell quoting techniques.
>
> -Tim
> *--------------------------------------------------------------------------*
> | Tim Maher, PhD     (206) 781-UNIX      (866) DOC-PERL     (866) DOC-UNIX |
> | tim(AT)Consultix-Inc.Com  http://TeachMePerl.Com  http://TeachMeUnix.Com |
> *+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-*
> |      Watch for my upcoming book: "Minimal Perl for UNIX/Linux People"    |
> *--------------------------------------------------------------------------*
> _____________________________________________________________
> Seattle Perl Users Group Mailing List
>      POST TO: spug-list at pm.org
> SUBSCRIPTION: http://mail.pm.org/mailman/listinfo/spug-list
>     MEETINGS: 3rd Tuesdays, Location: Amazon.com Pac-Med
>     WEB PAGE: http://seattleperl.org/
>



More information about the spug-list mailing list