четверг, 11 августа 2011 г.

Simple examples of grep (egrep, fgrep)

#!/bin/bash
echo -n 'Enter word: '
read word

#in all params of script calling
for i in $@                            
do

        #looking for word at the beginning of string

egrep ^$word $i  
        #looking for word at the end of string
        egrep $word$ $i
        #looking for strings without words windows, dos OR gates



        egrep -v "(windows|dos|gates)"         
done

Комментариев нет:

Отправить комментарий