File: misc2fortune

package info (click to toggle)
fortunes-es 1.36%2Bnmu1
  • links: PTS
  • area: main
  • in suites: sid, trixie
  • size: 1,304 kB
  • sloc: ansic: 629; makefile: 161; sh: 153; perl: 40
file content (53 lines) | stat: -rwxr-xr-x 1,112 bytes parent folder | download | duplicates (9)
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 lnea 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 despus con las tag de una lnea

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