Hi Lentila!
On Wed, 19 Dec 2001, Lentila de Vultur wrote:

> 
> 
> > > am un script bash in care utilizatorul introduce o adresa ip. cum pot
> > filtra
> > > input-ul astfel incat sa accept doar cifre shi "."?
> > > ma intereseaza in principiu solutzie bash/awk/sed dar orice idee e
> > > binevenita.
> > read x
> > x=`echo $x | sed 's/[^0-9.]//g'`
> 
> 10x dar m-am exprimat greshit.
> vreau ca scriptul sa dea un mesaj de eroare daca utilizatorul introduce alte
> caractere in afara de cifre shi ".".
so?

y=`echo $x | sed 's/[^0-9.]//g'`
if [ "$x" != "$y" ] ; then
    echo "bummer";
    exit;
fi

:)
 
-- teodor
---
Send e-mail to '[EMAIL PROTECTED]' with 'unsubscribe rlug' to 
unsubscribe from this list.

Raspunde prin e-mail lui