LINUX.ORG.RU

История изменений

Исправление KennyMinigun, (текущая версия) :

WORKDIR="${PWD}" # anywhere you want
KEYWORD="linux" 

for file in "${WORKDIR}"/* ; do
    if [ -r "$file" -a -f "$file" ]; then
        head -n 1 "$file" | grep -qi  "$KEYWORD" && echo "$file"
    fi
done

Исправление KennyMinigun, :

WORKDIR="${PWD}" # anywhere you want
KEYWORD="linux" 

for file in "${WORKDIR}/*" ; do
    if [ -r "$file" -a -f "$file" ]; then
        head -n 1 "$file" | grep -qi  "$KEYWORD" && echo "$file"
    fi
done

Исходная версия KennyMinigun, :

WORKDIR="${PWD}" # anywhere you want
KEYWORD="linux" 

for file in "${WORKDIR}/*" ; do
    if [ -r "$file" -a -f "$file" ]; do
        head -n 1 "$file" | grep -qi  "$KEYWORD" && echo "$file"
    done
done