shell-script-pt
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [shell-script] tabelinha para os amigos


From: Reinaldo Carvalho
Subject: Re: [shell-script] tabelinha para os amigos
Date: Thu, 14 Dec 2006 21:01:58 -0300

Patched version...  :P

# Shows a message with the selected collor as the first arg
function eccho () {
      local color="$1"
      case "$color" in
              -y|yellow)
                     shift
                      echo -e "\033[40;33m$@\033[m"
              ;;
              -b|blue)
                      shift
                      echo -e "\033[40;34m$@\033[m"
              ;;
              -r|red)
                      shift
                      echo -e "\033[40;31m$@\033[m"
              ;;
              -R|bold_red)
                      shift
                      echo -e "\033[40;31;1m$@\033[m"
              ;;
              *)
                      echo "$@"
      esac
}

On 12/14/06, Reinaldo Carvalho <address@hidden> wrote:
meus dois centavos...

# Shows a message with the selected collor as the first arg
function eccho () {
        local color="$1"
        shift
        case "$color" in
                -y|yellow)
                        echo -e "\033[40;33m $@ \033[m"
                ;;
                -b|blue)
                        echo -e "\033[40;34m $@ \033[m"
                ;;
                -r|red)
                        echo -e "\033[40;31m $@ \033[m"
                ;;
                -R|bold_red)
                        echo -e "\033[40;31;1m $@ \033[m"
                ;;
                *)
                        echo "$@"
        esac
}

--
Reinaldo Carvalho
Debian Sarge 3.1 - Linux User: #238310
Prodepa - address@hidden


On 12/13/06, Julio C. Neves <address@hidden> wrote:
> Para tirar proveito desta tabela que o Ivan (aka Czar) mandou, basta fazer:
>
> $ cores=$(echo "RED \e[m\e[31m
> GREEN \e[m\e[32m
> YELLOW \e[m\e[33m
> BLUE \e[m\e[34m
> MAGENTA \e[m\e[35m
> CYAN \e[m\e[36m
> WHITE \e[m\e[37m
> RVRED \e[m\e[7;31m
> RVGREEN \e[m\e[7;32m
> RVYELLOW \e[m\e[7;33m
> RVBLUE \e[m\e[7;34m
> RVMAGENTA \e[m\e[7;35m
> RVCYAN \e[m\e[7;36m
> RVWHITE \e[m\e[7;37m
> URED \e[m\e[4;31m
> UGREEN \e[m\e[4;32m
> UYELLOW \e[m\e[4;33m
> UBLUE \e[m\e[4;34m
> UMAGENTA \e[m\e[4;35m
> UCYAN \e[m\e[4;36m
> UWHITE \e[m\e[4;37m
> NRML \e[m\e[32m
> BOLD \e[m\e[7m
> CLEAR \e[2J\e[m" | sed "s/ /=\'/;s/$/\'/") # troquei o espaço por igual (=)
> e coloque tudo entre plics
> $ echo "$cores"
> RED='\e[m\e[31m'
> GREEN='\e[m\e[32m'
> YELLOW='\e[m\e[33m'
> BLUE='\e[m\e[34m'
> MAGENTA='\e[m\e[35m'
> CYAN='\e[m\e[36m'
> WHITE='\e[m\e[37m'
> RVRED='\e[m\e[7;31m'
> RVGREEN='\e[m\e[7;32m'
> RVYELLOW='\e[m\e[7;33m'
> RVBLUE='\e[m\e[7;34m'
> RVMAGENTA='\e[m\e[7;35m'
> RVCYAN='\e[m\e[7;36m'
> RVWHITE='\e[m\e[7;37m'
> URED='\e[m\e[4;31m'
> UGREEN='\e[m\e[4;32m'
> UYELLOW='\e[m\e[4;33m'
> UBLUE='\e[m\e[4;34m'
> UMAGENTA='\e[m\e[4;35m'
> UCYAN='\e[m\e[4;36m'
> UWHITE='\e[m\e[4;37m'
> NRML='\e[m\e[32m'
> BOLD='\e[m\e[7m'
> CLEAR='\e[2J\e[m'
> $ eval $cores
> $ echo -e "$RED vermelho \n $RVYELLOW fundo amarelo"
>  vermelho
>   fundo amarelo
>
> Abraços,
> Julio
> :wq
>
>
> 2006/12/13, Ivan lopes <address@hidden>:
> >
> >    RED \e[m\e[31m
> > GREEN \e[m\e[32m
> > YELLOW \e[m\e[33m
> > BLUE \e[m\e[34m
> > MAGENTA \e[m\e[35m
> > CYAN \e[m\e[36m
> > WHITE \e[m\e[37m
> > RVRED \e[m\e[7;31m
> > RVGREEN \e[m\e[7;32m
> > RVYELLOW \e[m\e[7;33m
> > RVBLUE \e[m\e[7;34m
> > RVMAGENTA \e[m\e[7;35m
> > RVCYAN \e[m\e[7;36m
> > RVWHITE \e[m\e[7;37m
> > URED \e[m\e[4;31m
> > UGREEN \e[m\e[4;32m
> > UYELLOW \e[m\e[4;33m
> > UBLUE \e[m\e[4;34m
> > UMAGENTA \e[m\e[4;35m
> > UCYAN \e[m\e[4;36m
> > UWHITE \e[m\e[4;37m
> > NRML \e[m\e[32m
> > BOLD \e[m\e[7m
> > CLEAR \e[2J\e[m
> >
> > --
> > [ ]'s
> > Ivan Carlos Da Silva Lopes
> >
> > Engenheiro Eletronico e Computacao
> > UFRJ
> >
> >
>
>
>
> --
> Abraços,
> Julio
> http://www.julioneves.com - Um livro sobre Bash completo e on-line
> :wq
>
>
> [As partes desta mensagem que não continham texto foram removidas]
>
>
>
> ---------------------------------------------------------------------
> Esta lista não admite a abordagem de outras liguagens de programação, como 
perl, C etc. Quem insistir em não seguir esta regra será moderado sem prévio aviso.
> ---------------------------------------------------------------------
> Sair da lista: address@hidden
> ---------------------------------------------------------------------
> Esta lista é moderada de acordo com o previsto em 
http://www.listas-discussao.cjb.net
> ---------------------------------------------------------------------
> Servidor Newsgroup da lista: news.gmane.org
> Grupo: gmane.org.user-groups.programming.shell.brazil
>
>
> Links do Yahoo! Grupos
>
>
>



--
Reinaldo Carvalho
Debian Sarge 3.1 - Linux User: #238310
Prodepa - address@hidden


reply via email to

[Prev in Thread] Current Thread [Next in Thread]