2020-03-18 22:25:24 +00:00
|
|
|
#!/bin/bash
|
|
|
|
|
2020-03-20 14:55:45 +00:00
|
|
|
QUERY=`echo $1 | tr ' ' ' ' | sed 's/&/\&/g; s/</\</g; s/>/\>/g; s/"/\"/g; s/'"'"'/\'/g'`
|
2020-03-18 22:25:24 +00:00
|
|
|
|
|
|
|
|
2020-05-05 23:45:43 +00:00
|
|
|
for fn in `grep -rEic $QUERY content | grep -v ':0' | sort -t: -nrk2 | awk -F: '{print $1}'`;do
|
2020-03-19 00:02:21 +00:00
|
|
|
PA=$fn
|
2020-03-19 13:08:50 +00:00
|
|
|
echo "<div class='box'><a href='"`head -n 2 $PA | tail -n 1`"'>"`head -n 1 $PA | head -c 30`"</a><p>"`grep -i $QUERY $PA | sed 's/&/\&/g; s/</\</g; s/>/\>/g; s/"/\"/g; s/'"'"'/\'/g' | head -n 2 | head -c 100`"</p></div>"
|
2020-03-18 23:18:38 +00:00
|
|
|
done
|
2020-03-18 22:25:24 +00:00
|
|
|
|
|
|
|
|