Professional Web Applications Themes

command line execution -- colors - PHP Development

Hello group, I wonder is it possible and how to output text in color? The script is intended to be executed in command line. I can use echo, printf() /<- prefered/ functions. Output will go to STDOUT of linux terminal. Any ideas? Thanks...

  1. #1

    Default command line execution -- colors

    Hello group,

    I wonder is it possible and how to output text in color? The
    script is intended to be executed in command line. I can use
    echo, printf() /<- prefered/ functions. Output will go to
    STDOUT of linux terminal.
    Any ideas?

    Thanks
    Kleist Guest

  2. #2

    Default Re: command line execution -- colors

    Kleist wrote:
     

    Yes - use the ncurses PECL.

    C.

    Colin Guest

  3. #3

    Default Re: command line execution -- colors

    Colin McKinnon wrote: 
    >
    >
    > Yes - use the ncurses PECL.
    >
    > C.
    >[/ref]

    Thanks for reply! Could you be more spesific about ncurses
    PECL, I coud not find it on php.net
    Kleist Guest

  4. #4

    Default Re: command line execution -- colors

    Kleist wrote: 

    http://www.php.net/manual/en/ref.ncurses.php


    -veikko

    --
    veikko
    mail .com
    makinen
    Veikko Guest

  5. #5

    Default Re: command line execution -- colors

    Veikko Mäkinen wrote: 
    >
    >
    > http://www.php.net/manual/en/ref.ncurses.php
    >
    >
    > -veikko
    >[/ref]
    Got it, but I don`t no how to perform the output.

    My code goes like:

    ncurses_init();

    ncurses_start_color();
    ncurses_init_pair (1, NCURSES_COLOR_RED, NCURSES_COLOR_BLACK);
    ncurses_init_pair (2, NCURSES_COLOR_GREEN, NCURSES_COLOR_BLACK);


    function chklimit() {

    // here I set colors ncurses_color_set()
    // and form a string to output with two color pairs

    }

    if ($a) {
    ncurses_addstr(chklimit($dirName));
    }

    ncurses_end();
    Kleist Guest

Similar Threads

  1. command line
    By Sarah Tanembaum in forum Windows Server
    Replies: 2
    Last Post: June 30th, 07:06 AM
  2. RUN/execute a Command-Line command from an ASP page
    By Lucas Cowald in forum ASP.NET Building Controls
    Replies: 1
    Last Post: October 22nd, 04:26 PM
  3. RUN/execute a Command-Line command from an ASP page.
    By Lucas Cowald in forum ASP Components
    Replies: 7
    Last Post: October 22nd, 01:08 PM
  4. Replies: 0
    Last Post: August 15th, 10:03 PM
  5. command execution upon ssh
    By nori heikkinen in forum Debian
    Replies: 3
    Last Post: July 3rd, 11:10 AM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139