[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Criar tabela html
From: |
trans548 |
Subject: |
Re: Criar tabela html |
Date: |
Sun, 28 Oct 2007 15:17:49 -0000 |
User-agent: |
eGroups-EW/0.82 |
--- Em address@hidden,
"mop" <mop2bky4mz5tyjwa8ersp7hrg5u9qn@...> escreveu
>
> Por certo sua questão é HTML!
>
> Se não, mostre o resultado final desejado (código em html), lembre
que
> interpretação e análise de html foge ao escopo da lista.
>
> Se desejar mostrar sinteticamente o já que obteve, mal não deve
fazer.
>
>
> ------------------------------------------------------------------
> A minha questao é Shell Script mesmo.. e atendendo seu pedido,
mostro o script que fiz, porem como falei a cima.. ele cria apenas um
link por linha e eu quero he que fique igual ao resultado do comando
'ls -C'. Se alguem poder ajudar, agradeço.
Este é o scritp :
#!/bin/bash
#cria tabela htm
n=$1
if [ $# -ne 1 ]
then
echo
echo "Digite o nome da pagina"
echo
exit 1
fi
i=0
while read line
do
i=$((i+1))
if [ "$((i%2))" == "0" ]
then
echo "</td></tr><tr bgcolor=#778899><td>"
else
echo "</td></tr><tr><td>"
fi
echo $line
done < $n > ${n}b
#insere cabeçalho html no index.html
echo "<html> <body>" > index.html
echo "<table width=100% border=0 cellpadding=1 cellspacing=0>" >>
index.html
#pasando as tags da tabela para o index
cat ${n}b >> index.html
# fechando as tags
echo "</table></body></html>" >> index.html
echo
echo "Index pronto"