string split, bash and IFS

Unga unga888 at
Mon Aug 25 09:39:39 UTC 2008

Hi all

How to use bash and IFS to split a string?

$string = "Name:Surname:10"
echo "$string" | read name surname age

This does not work for some reason. The read does not create name, surname and age variables. Any idea why?

Appreciate your reply.

Kind regards


More information about the freebsd-questions mailing list