Finding position of space in a variable

view full story

http://www.unix.com – HI All, am trying to find the position of space in a variable, it is working for other characters other than space ulab="ulab1|ulab2" find_pos=`expr index $ulab '|'` echo $find_pos above code worked fine but below one says syntax error ulab="ulab ulab2" find_pos=`expr index $ulab ' '` echo $find_pos can some one please help me.... Many thanks (HowTos)