Colourising the "You've Got Mail" message - revised - BSD

This is a discussion on Colourising the "You've Got Mail" message - revised - BSD ; So rather than messing with biff and its associated bits and bobs, I'm trying to set it through MAILPATH instead (as had been suggested). However I'm a little confused by the syntax. I've tried various variations along the lines of: ...

+ Reply to Thread
Results 1 to 4 of 4

Thread: Colourising the "You've Got Mail" message - revised

  1. Colourising the "You've Got Mail" message - revised

    So rather than messing with biff and its associated bits and bobs, I'm
    trying to set it through MAILPATH instead (as had been suggested).

    However I'm a little confused by the syntax. I've tried various
    variations along the lines of:

    MAILPATH=/var/mail/jim%"\[\033[1;30m\] New Mail! \[\033[0m\]"; export
    MAILPATH

    but it prints the sequence as plain text.

    I assume I'm getting something simple wrong but I don't know what.

    Any hints?

    $TERM reveals 'xterm-color' if that helps.

    Many thanks.

    Jim
    --
    Find me at : http://www.ursaminorbeta.co.uk
    Please help to bring old whisky literature back into print - visit
    www.ClassicExpressions.co.uk

  2. Re: Colourising the "You've Got Mail" message - revised

    Jim wrote:

    >
    > MAILPATH=/var/mail/jim%"\[\033[1;30m\] New Mail! \[\033[0m\]"; export
    > MAILPATH
    >
    > but it prints the sequence as plain text.


    Hmmm. Also tried:

    RED="\[\033[0;31m\]"
    NORMAL="\[\033[0m\]"

    and they work when part of a PS1 prompt, but still not in MAILPATH.

    Using bash.

    Jim
    --
    Find me at http://www.ursaminorbeta.co.uk
    AIM/iChatAV: JCAndrew2
    Skype: greyarea

  3. Re: Colourising the "You've Got Mail" message - revised

    On Thu, 25 Oct 2007 21:47:32 +0100, jim@magrathea.plus.com (Jim)
    wrote:

    >Jim wrote:
    >
    >>
    >> MAILPATH=/var/mail/jim%"\[\033[1;30m\] New Mail! \[\033[0m\]"; export
    >> MAILPATH


    See: bash(1)
    Look closely at MAILPATH example:

    See those _single_ quotes? Shell variable assignments must be
    enclosed in quotes.

    File name must be separated from the message to be printed by a
    question mark.

    >>
    >> but it prints the sequence as plain text.

    >
    >Hmmm. Also tried:
    >
    >RED="\[\033[0;31m\]"
    >NORMAL="\[\033[0m\]"
    >
    >and they work when part of a PS1 prompt, but still not in MAILPATH.
    >
    >Using bash.
    >


    Once upon a time, I did color this way:

    #!/bin/sh
    COLORON=`echo -e "\e[2;2x"`
    COLOROFF=`echo -e "\e[x"`
    printf "\n\n%s %s %s\n\n" "$COLORON" "A GREEN Christmas" "$COLOROFF"

    See: screen(4) for escape codes

    The above example works only when running in native terminal mode. It
    will not work in a X-windows terminal emulator.

    I suggest you try putting the color assignment statments into your
    .profile file so that the evironment gets set up upon login, and then
    try putting the variables into the MAILPATH assignment string.
    Whether this will work or not depends on how the MAILPATH string is
    parsed and sent to the screen.



  4. Re: Colourising the "You've Got Mail" message - revised

    Speechless wrote:
    > Once upon a time, I did color this way:


    > #!/bin/sh
    > COLORON=`echo -e "\e[2;2x"`
    > COLOROFF=`echo -e "\e[x"`
    > printf "\n\n%s %s %s\n\n" "$COLORON" "A GREEN Christmas" "$COLOROFF"


    > See: screen(4) for escape codes


    > The above example works only when running in native terminal mode. It
    > will not work in a X-windows terminal emulator.


    map tput

    (though I forget if FreeBSD is using ncurses tput, or the lobotomized BSD 4.2
    program ;-)

    --
    Thomas E. Dickey
    http://invisible-island.net
    ftp://invisible-island.net

+ Reply to Thread