NYCPHP Meetup

NYPHP.org

[nycphp-talk] exec() funciton help

@ndres ameseguer at gmail.com
Sat Aug 5 15:48:46 EDT 2006


On 8/5/06, Dan Cech <dcech at phpwerx.net> wrote:
>
> Dan Cech wrote:
> > secondly, redirect stderr from the svn log command to stdout so that you
> > can see any errors it outputs and react to them:
> >
> > 1. use 1>&3 to 'save' stdout
> > 2. redirect stdout to the output file with 1>filename
> > 3. redirect stderr to the 'saved' stdout with 2>&3
> >
> > Here is some example code:
> >
> >   exec('/usr/bin/svn log -v 1>&3 1>'.$file.' 2>&3',$output,$retval);
>
> I just realised there is a much simpler way to achieve this:
>
> exec('/usr/bin/svn log -v 2>&1 1>'.$file,$output,$retval);
>
> Dan
> _______________________________________________
> New York PHP Community Talk Mailing List
> http://lists.nyphp.org/mailman/listinfo/talk
>
> NYPHPCon 2006 Presentations Online
> http://www.nyphpcon.com
>
> Show Your Participation in New York PHP
> http://www.nyphp.org/show_participation.php
>


You better use ssh2 functions
-- 
                                                    ,  ,
                                                    / \/ \
                                                   (/ //_ \_
          .-._                                      \|| .   \
           \  '-._                            _,:__.-"/---\_ \
      ______/___  '.    .--------------------'~-'--.)_,( , )\ \
     `'--.___  _\  /    |       @ndrés Meseguer    ,'    \)|\ `\|
        /___.-'  \ \ _:,_           IC-ITCR             " ||   (
        .'__ _.'\ '-/,`-~`         Costa Rica             |/
            \  ___.> /=,|email:ameseguer at gmail.com        |
            / _.-'/_ )  |      ameseguer at ic-itcr.ac.cr    |
        snd /`   ( /(/  |_________________________________|
                  \\ "
                   '=='
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.nyphp.org/pipermail/talk/attachments/20060805/b0ef10ad/attachment.html>


More information about the talk mailing list