Go to:
http://www.linuxquestions.org/questions/programming-9/bash-shell-script-split-array-383848/?posted=1#post3270996
And see:
IP=1.2.3.4; IP=(${IP//./ }); Rev=${IP[3]}.${IP[2]}.${IP[1]}.${IP[0]}


Unga wrote:
> 
> Hi all
> 
> How to use bash and IFS to split a string?
> 
> eg. 
> $string = "Name:Surname:10"
> IFS=:
> 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
> Unga
> 
> 
>       
> _______________________________________________
> freebsd-questions@freebsd.org mailing list
> http://lists.freebsd.org/mailman/listinfo/freebsd-questions
> To unsubscribe, send any mail to
> "[EMAIL PROTECTED]"
> 
> 

-- 
View this message in context: 
http://www.nabble.com/string-split%2C-bash-and-IFS-tp19140697p19340538.html
Sent from the freebsd-questions mailing list archive at Nabble.com.

_______________________________________________
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to "[EMAIL PROTECTED]"

Reply via email to