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

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

Re: [shell-script] Script Boas Festas


From: Fernando Lemes da Silva
Subject: Re: [shell-script] Script Boas Festas
Date: Tue, 11 Dec 2007 09:16:27 -0200
User-agent: KMail/1.9.6

   Devo estar comendo bola, mas ainda não descobri o porque do erro abaixo:

./natal.sh: line 9: syntax error near unexpected token `('
./natal.sh: line 9: `         for ((i=1; i<20; i+=2))'

   Alguma luz??

   []'s

-- 
   0010111100101010010100110100100101000111
       Fernando LEMES da Silva
       www.koho.com.br (0x43fca35b)
   0101001101001001010001110010101000101111



On Monday 10 December 2007 9:02:28 pm Alain M. wrote:
> Só faltou limpara a tela para começar!
> ---->
>
> Com um pouco mais de cores
>
> #!/bin/bash
> clear
> trap 'reset; exit' 2
> while true; do
>          lin=2
>          col=$(($(tput cols) / 2))
>          c=$((col-1))
>          tput setaf 2; tput bold
>          for ((i=1; i<20; i+=2))
>          {
>                  tput cup $lin $col
>                  for ((j=1; j<=i; j++))
>                  {
>                          echo -n \*
>                  }
>                  let lin++
>                  let col--
>          }
>          tput sgr0; tput setaf 3
>          for ((i=1; i<=2; i++))
>          {
>                  tput cup $((lin++)) $c
>                  echo '|||'
>          }
>          tput cup $lin $((c - 4)); echo BOAS FESTAS
>          let c++
>          tput bold
>          for ((i=1; i<=15; i++))
>          {
>                  li=$((RANDOM % 9 + 3))
>                  ini=$((c-li+2))
>                  fim=$((c+li+2))
>                  co=$((RANDOM % (li-2) * 2 + 1 + ini))
>                  color=$((RANDOM % 10))
>                  tput setaf $color
>                  tput cup $li $co
>                  echo '*'
>          }
>          tput cup $((lin+2)) 0; tput civis; sleep 0.4; tput sgr0
> done
>
>
>
> Boas Festas
> Alves


reply via email to

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