mirror of https://xfnw.ttm.sh/git/huntnw.git
12 lines
474 B
Bash
Executable File
12 lines
474 B
Bash
Executable File
#!/bin/bash
|
|
|
|
QUERY=`echo $1 | tr ' ' ' ' | sed 's/&/\&/g; s/</\</g; s/>/\>/g; s/"/\"/g; s/'"'"'/\'/g'`
|
|
|
|
|
|
for fn in `grep -rEic $QUERY content | grep -v ':0' | sort -t: -nrk2 | awk -F: '{print $1}'`;do
|
|
PA=$fn
|
|
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>"
|
|
done
|
|
|
|
|