My favorites | Sign in
Project Home Downloads Wiki Issues Source
Checkout   Browse   Changes    
 
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
# ----------------------------------------------------------------------------
# http://www.ibiblio.org
# Procura documentos do tipo HOWTO.
# Uso: zzhowto [--atualiza] palavra
# Ex.: zzhowto apache
# zzhowto --atualiza
#
# Autor: Thobias Salazar Trevisan, www.thobias.org
# Desde: 2002-08-27
# Licença: GPL
# ----------------------------------------------------------------------------
zzhowto ()
{
zzzz -h howto "$1" && return

local padrao
local cache="$ZZTMP.howto"
local url='http://www.ibiblio.org/pub/Linux/docs/HOWTO/other-formats/html_single/'

# Verificação dos parâmetros
[ "$1" ] || { zztool uso howto; return 1; }

# Força atualização da listagem apagando o cache
if [ "$1" = '--atualiza' ]
then
rm -f "$cache"
shift
fi

padrao=$1

# Se o cache está vazio, baixa listagem da Internet
if ! test -s "$cache"
then
$ZZWWWHTML "$url" |
sed -n '/alt="\[TXT\]"/ {
s/^.*href="\([^"]*\).*/\1/
p
}' > "$cache"
fi

# Pesquisa o termo (se especificado)
if [ "$padrao" ]
then
zztool eco "$url"
grep -i "$padrao" "$cache"
fi
}

Change log

r710 by aureliojargas on Mar 29, 2012   Diff
SEGURANÇA: $1 colocado entre aspas na
chamada padrão zzzz -h de todas as
funções.
Go to: 
Sign in to write a code review

Older revisions

r668 by aureliojargas on Mar 28, 2012   Diff
lint: removendo espaços inúteis.
r524 by aureliojargas on May 23, 2011   Diff
COMBO: Agora todas as chamadas ao
zztool uso por falha na verificação
dos parâmetros possuem um return 1
depois. Assim outros scripts que usam
as funções podem detectar erros.
r260 by aureliojargas on Dec 21, 2010   Diff
COMBO: mudança em todas as funções
para trocar a ordem das linhas no
cabeçalho. Agora é:

- Descrição de uma linha
...
All revisions of this file

File info

Size: 1081 bytes, 48 lines
Powered by Google Project Hosting