Re: grep shell script mit variablem Suchmuster

Christof Janssen <[email protected]>
Newsgroups gmane.linux.suse.programming
Message-ID <[email protected]>
hallo,

leider tritt in der Zeile

ret=`grep -c "DP  - $i" textdatei`;

immer wieder derselbe Fehler auf - es werden 0 Einträge  
zurückgegeben, da (so meine Vermutung) nicht ausgewertet sondern als  
Expression gesucht wird.

Wie kann man da Abhilfe schaffen ?

Christof janssen

Am 24. Jun 2005 um 13:42 schrieb Stefan Galinski:

> for i in `seq 1900 2000`
> do
>         ret=`grep -c "DP  - $i" textdatei`;
>         if [ $ret -gt 0 ]
>         then
>                 echo $i - $ret;
>         fi
> done


-- 
Um die Liste abzubestellen, schicken Sie eine Mail an:
    [email protected]
Um eine Liste aller verfügbaren Kommandos zu bekommen, schicken
Sie eine Mail an: [email protected]
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.