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" ???
Scuze de raspunsul anterior, nu m-am uitat in manual.
Din man expr, metoda recomandata este (dar ei au uitat ghilimelele, si
cu exemplul tau ar da iar syntax error).
x=`expr "$b" : '.*'`
Cat despre index, ce face / ar trebui sa faca?
Alex
------------+-------------------------------------------------------
Alex Popa, | "Computer science is no more about computers than
[EMAIL PROTECTED]| astronomy is about telescopes" -- E. W. Dijkstra
------------+-------------------------------------------------------
__________________________________________________________
Send 'unsubscribe rofug' to [EMAIL PROTECTED] to unsubscribe