mirror of
https://xfnw.ttm.sh/git/huntnw.git
synced 2024-09-14 13:03:27 +00:00
12 lines
465 B
Bash
Executable File
12 lines
465 B
Bash
Executable File
#!/bin/bash
|
|
|
|
QUERY=`echo $1| 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
|
|
|
|
|