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
49
50
51
52
53
|
#!/bin/sh
if [ "X$1" = "X" ]; then
echo "Falta al menos directorio destino"
exit 1
fi
test -d $1 || mkdir -p $1
# Eligiendo el fichero de salida
if [ "X$2" = "X" ]; then
TARGET=$1/eslinux
else
TARGET=$1/$2
fi
# Buscando los preparados para el programa chorrada de Urko Lusa
CHOFILES=`echo *.cho | sed 's/\*.cho//g'`
#echo $CHOFILES found
ALLCHOFILES=allchofiles
# Buscando las tags de una línea en formato 'plano'
TXTTAGFILES=`echo *.txttag | sed 's/\*.txttag//g'`
#echo $TXTTAGFILES found
TXTTAGALLFILES=txttagallfiles
# Procediendo. Primero limpiamos y empezamos con los de chorrada
rm -f $TARGET
if [ "X$CHOFILES" != "X" ]; then
echo "Encontrados $CHOFILES"
cat $CHOFILES > $ALLCHOFILES
cat $ALLCHOFILES | tr '\r' '\n' | sed 's/^$/%/g' > $TARGET
fi
#exit
# y después con las tag de una línea
if [ "X$TXTTAGFILES" != "X" ]; then
echo "Encontrados $TXTTAGFILES"
cat $TXTTAGFILES > $TXTTAGALLFILES
cat $TXTTAGALLFILES | sed 's/.*$/&¬/g' | tr '¬' '\n' | sed 's/^$/%/g' >> $TARGET
fi
# y generamos el índice de fortune
echo "Generando el índice"
strfile $TARGET
|