Re: [exim] Need a little bash scripting help [OT]

トップ ページ
このメッセージを削除
このメッセージに返信
著者: Heiko Schlittermann
日付:  
To: exim-users
題目: Re: [exim] Need a little bash scripting help [OT]
Marc Perkel <marc@???> (So 12 Dez 2010 23:26:54 CET):
> > in bash:
> >
> > $ cat test.txt | sort | uniq -c | while read line; do count=${line% *}; if
> > [ $count -ge 3 ]; then echo ${line/*$count /}; fi; done
> > four
> > three
> > $
> >
> > Cheers,
>
> Thanks but I'm getting "too many arguments" on
>
> [ $count -ge 3 ];


If you quote $count

    [ "$count" -ge 3 ]


the error will disappear. But this would fix just the symptom, as any
line should have a count prepended.

--
Heiko :: dresden : linux : SCHLITTERMAN.de
GPG Key 48D0359B : 3061 CFBF 2D88 F034 E8D2 7E92 EE4E AC98 48D0 359B