Results 1 to 1 of 1
I move a page from a server in Suse to Debian and this script was working well but when i move the page to a Debian base server it is ...
- 04-19-2010 #1Just Joined!
- Join Date
- Jan 2008
- Posts
- 53
cgi-bin in bash is sending "cat: write error: Broken pipe,"
I move a page from a server in Suse to Debian and this script was working well but when i move the page to a Debian base server it is sending in the logs the following message:
cat: write error: Broken pipe, referer: http://domain.example/cgi-bin/search.sh
the cgi does the following, read a db file plain text that repeat each 15 lines an information where to look the seraching info. if it is there sends to the output the 15 lines block. but it was not sending errors in suse distro, does anybody knows why the cat's line are sending "cat: write error: Broken pipe," if i am not writing or making a pipe with ">" to none file.
----np=`echo $POST_DATA | wc -c`
for data in `ls /srv/virtual/wfolder/$seccion/db`;do
seccion_search=`echo $data | awk -F/ '{print $5}'`
n=`cat $data | wc -l`
#Look the first line is o not empty
fl=`cat $data | head -1 | wc -w`
if let "fl==0";then
ini=15
else
ini=14
fi
echo "<tr bgcolor=\"#CCCC99\"><td><A NAME=\""`echo $data | awk -F/ '{print $5}' `"|region\">"$seccion_search"</td></tr>"
end=""
if let "np>1"; then
for (( i=0;i<=$n; ))
do
ishead=`cat $data | head -$i | tail -1 | grep \<\!--begin | wc -w`
let $j "j=i+1"
iddate=`cat $data | head -$j | tail -1 | awk '{print $2}' | awk -F"-" '{print $1}'`
if let "ishead>0";then
let $i "i+=13"
content=`cat $data | head -$i | tail -14 `
iffound=`echo $content | grep $browser | wc -l`
if let "iffound>0";then
echo "<tr><td>"
datline=`cat $data | head -$i | tail -14`
title=`echo $datline | sed "s/\//._./g"`
sectitle=`echo $title | awk -F">" '{print $8}' | awk -F"<" '{print $1}' `
title1=`echo $title | sed "s/>${sectitle}</><a href=\"http:\/\/domain.example\/$seccion_search\/index.html#$seccion_search|$iddate\">$sectitle<._. a></g"`
echo $title1 | sed "s/._./\//g"
#cat $data | head -$i | tail -14
echo "<br><A HREF=\"#home|region\"><b>Regresar al Inicio</A></td></tr>"
fi
fi
let $i "i+=1"
done
fi
done
Linux User #501817


Reply With Quote
