i want to extract a word from a sentence in bash script .it uses both coma and space as separators.
ex:- date=crossed 122 name=foo , userid=234567 , sessionid=2233445axdfg5209 associd=2
I have above sentence in which the interesting part is name=foo .the key name is always same but the string foo may vary. also other parameters may or may not be there .
i need to extract above key value pair. so output would be :
name=foo
what is the best way to do it in shell script?
thanks!