String questions from shell script

Dave Tiger dave at
Thu Apr 15 13:53:15 BST 2004

Hi List,

Thanks Roger (without d) for your great help earlier.

I now ask the list if you could help me with two string related questions.

The first is how do I split a string. From my earlier question Roger showed
me how to connect MySql using sh and return values.

$col2 is one vale that returns and email address ie user at and I
would like to know how to split that to be left with only I
have tried "split($col2,a,"@") but I keep getting errors saying "Syntax
error: word unexpected (expecting ")")  " and this is confusing me.

Second. Once I have "" how do I search a file for that and write
a line underneath its where it is found in the file.

These are the only two bits that draw a blank searching the web and looking
at my books so if anyone could help with this I would really appreciate it.

Thank you in advance for any help or guidance

Dave C

Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (
Version: 6.0.657 / Virus Database: 422 - Release Date: 13/04/2004

More information about the Ukfreebsd mailing list