Error ínea 42: [: demasiados argumentos
Publicado por Path (4 intervenciones) el 04/12/2012 03:55:36
Hola que tal a todos, tengo un problema con mi codigo y no lo encuentro, me podrian ayudar? me diceque demasiados argumentos....(el error me lo marca en la lineas que puse en el codigo)
(if [ $line == $archivo ]; then)<-----------------------
Tambien quisiera saber como hacerle para que el html se actualice solo, como le podria hacer?
(if [ $line == $archivo ]; then)<-----------------------
Tambien quisiera saber como hacerle para que el html se actualice solo, como le podria hacer?
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
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
#!/bin/bash
cd
Dir_Check="Documentos/Archivos"
Dir_Apache="/var/www/Proyecto_ASO.html"
mkdir -p ~/Documentos/tmp
Dir_tmp="Documentos/tmp"
function Archivos(){
sha512sum $Dir_Check/* > $Dir_tmp/doc_SHA512
docs=`find $Dir_Check -type f | wc -l`
}
Archivos
echo "Proyecto De Administracion De Sistemas Operativos"
echo
for ((i=0;i<10000;i++))
do
docComp=`find $Dir_Check -type f | wc -l`
sha512sum $Dir_Check/* > $Dir_tmp/doc_SHA512_tmp
if [ $docComp != $docs ]; then
Archivos
fi
diff -e $Dir_tmp/doc_SHA512 $Dir_tmp/doc_SHA512_tmp > $Dir_tmp/Dif.txt
if [ -s $Dir_tmp/Dif.txt ]; then
#echo '<body>href="javascript:location.reload()"' >> /var/www/Archivos/index.html
cat ~/$Dir_tmp/Dif.txt | head -2 | tail -1 |cut -d ' ' -f 3|cut -d '/' -f 3 > ~/$Dir_tmp/arc
archivo=`cat ~/$Dir_tmp/arc`
alerta="--------->Alerta!!! El Archivo Se Ha Modificado!"
ls -B ~/$Dir_Check | grep -v "^d" > $Dir_tmp/nom_d_archivos
echo "<html><head><title>Proyecto ASO</title></head>" > $Dir_Apache
echo "<h1>Directorio --> ~/Documentos/Archivos</h1>" >> $Dir_Apache
echo "<body>" >> $Dir_Apache
while read line
do
='editor_line'>
if [ $line == $archivo ]; then
='editor_line'>
echo '<body><a href="'>> $Dir_Apache
echo ~/$Dir_Check/$line >> $Dir_Apache
echo '">' >> $Dir_Apache
echo $line$alerta >> $Dir_Apache
echo '</a>' >> $Dir_Apache
echo "<br>" >> $Dir_Apache
else
echo '<body><a href="'>> $Dir_Apache
echo ~/$Dir_Check/$line >> $Dir_Apache
echo '">' >> $Dir_Apache
echo $line >> $Dir_Apache
echo '</a>' >> $Dir_Apache
echo "<br>" >> $Dir_Apache
fi
done < $Dir_tmp/nom_d_archivos
echo "</body>" >> $Dir_Apache
else
ls -B ~/$Dir_Check | grep -v "^d" > $Dir_tmp/nom_d_archivos
echo "<html><head><title>Proyecto ASO</title></head>" > $Dir_Apache
echo "<h1>Directorio --> ~/Documentos/Archivos</h1>" >> $Dir_Apache
#echo '<body> setInterval ("location.reload()",2000); </body>' >> $Dir_Apache
echo "<body>" >> $Dir_Apache
while read line
do
echo '<body><a href="'>> $Dir_Apache
echo ~/$Dir_Check/$line >> $Dir_Apache
echo '">' >> $Dir_Apache
echo $line >> $Dir_Apache
echo '</a>' >> $Dir_Apache
echo "<br>" >> $Dir_Apache
done < $Dir_tmp/nom_d_archivos
echo "</body>" >> $Dir_Apache
fi
sleep 3
#echo '<body><a>href="javascript:location.reload()">Actualizar</a>' >> $Dir_Apache
done
Valora esta pregunta
0