How do I print 2>&1 in color???

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Phil Powell

    How do I print 2>&1 in color???

    exec("chmod 0644 $fyl 2>&1");

    This PHP command, as you know, will evoke an EXEC to do CHMOD on the
    command line. Everything works fine, including printing the
    appropriate error message piped out to STDOUT.

    However, I would like the error messages in color. How do I do that
    with 2>&1 within PHP or whatever?

    Thanx
    Phil
  • David Efflandt

    #2
    Re: How do I print 2>&1 in color???

    On 26 Jan 2004 08:26:17 -0800, Phil Powell <soazine@erols. com> wrote:[color=blue]
    > exec("chmod 0644 $fyl 2>&1");
    >
    > This PHP command, as you know, will evoke an EXEC to do CHMOD on the
    > command line. Everything works fine, including printing the
    > appropriate error message piped out to STDOUT.
    >
    > However, I would like the error messages in color. How do I do that
    > with 2>&1 within PHP or whatever?[/color]

    PHP sounds like a browser issue, so you would use normal html methods to
    set/clear font color before/after. If it was a shell script in a
    terminal, you could use ansi screen codes like:

    echo -ne "\033[01;31m"; chmod 0644 bogus.file 2>&1; echo -ne "\033[0m"

    But not sure how to plug that into exec().

    --
    David Efflandt - All spam ignored http://www.de-srv.com/

    Comment

    • Phil Powell

      #3
      Re: How do I print 2&gt;&amp;1 in color???

      efflandt@xnet.c om (David Efflandt) wrote in message news:<slrnc1aqp d.qlm.efflandt@ typhoon.xnet.co m>...[color=blue]
      > On 26 Jan 2004 08:26:17 -0800, Phil Powell <soazine@erols. com> wrote:[color=green]
      > > exec("chmod 0644 $fyl 2>&1");
      > >
      > > This PHP command, as you know, will evoke an EXEC to do CHMOD on the
      > > command line. Everything works fine, including printing the
      > > appropriate error message piped out to STDOUT.
      > >
      > > However, I would like the error messages in color. How do I do that
      > > with 2>&1 within PHP or whatever?[/color]
      >
      > PHP sounds like a browser issue, so you would use normal html methods to
      > set/clear font color before/after. If it was a shell script in a
      > terminal, you could use ansi screen codes like:
      >
      > echo -ne "\033[01;31m"; chmod 0644 bogus.file 2>&1; echo -ne "\033[0m"
      >
      > But not sure how to plug that into exec().[/color]


      I just plugged it in as is incorporating it into a PHP variable..
      works like a charm, thanx so much!

      Phil

      Comment

      Working...