String questions from shell script

Dave Tiger dave at tigeri.com
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 example.com and I
would like to know how to split that to be left with only example.com. 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 "example.com" 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 (http://www.grisoft.com).
Version: 6.0.657 / Virus Database: 422 - Release Date: 13/04/2004
 





More information about the Ukfreebsd mailing list