( x-daemon | 2007. 06. 06., sze – 21:17 )

kiirja a fileneveket amiben az keresendo szo megtalalhato. ha nem jo tovabbfejleszted :)

#!/bin/bash

SEARCH=$1
DIR=$2

if [ -z $DIR ]; then DIR="."; fi
if [ -z $SEARCH ]; then SEARCH="keres"; fi

echo "Searching for '"$SEARCH"' ..."
export SEARCH

/usr/bin/find $DIR -type f \
| /usr/bin/awk '{ print "if [ -n \"`/bin/cat \\\""$0"\\\" | /bin/grep -i \\\"$SEARCH\\\"`\" ]; then echo \"=== "$0" ===\"; fi" }' \
| /bin/sh