On Tuesday 20 July 2004 14:20, Alex Popa wrote:
> On Tue, Jul 20, 2004 at 02:11:02PM +0300, Mihai Gheorghe wrote:
> > stie cineva de ce nu pot folosi expr cu stringuri (asa cum merge pe
> > orice linux)?
> >
> > #!/bin/sh
> >
> > b="jk adsf"
> > x=`expr length $b`
> > echo $x
> > __________________
> >
> > la length problema e simpla deoarece pot inlocui cu x=${#b}, dar
> > cum pot inlocui "expr index" ???
>
> Incearca x=`expr length "$b"`
>
> Subliniez ghilimelele.
>
> Alex

Se pare ca implementarea expr din freebsd nu are length. Ar merge 
folosit awk:

index(s, t)             returns the index of the string t in the string
                               s, or 0 if t is not present.

length([s])             returns  the  length  of  the  string s, or the
                               length of $0 if s is not supplied.

-- 
Serghei.
__________________________________________________________
Send 'unsubscribe rofug' to [EMAIL PROTECTED] to unsubscribe

Raspunde prin e-mail lui