On Tue, Jun 9, 2009 at 6:37 PM, Nelson Serafica<[email protected]> wrote: > Here is the file: > > #!/usr/bin/perl > > #===========whitelist start======================= > $whitelist = $whitelist . " > [email protected] > [email protected] > "; > #===========whitelist end======================= > > > #===========blacklist start===================== > $blacklist = $blacklist . " > [email protected] > [email protected] > "; > #===================blacklist end=============== > > I have a file containing above. I need to create 2 variables. 1 variable > containing the text inside whitelist start and whitelist end and 1 variable > containing the text inside blacklist start and blacklist end. What will > happen is variable 1 will have [email protected] and [email protected] while > variable 2 is [email protected] and [email protected] > > Is there a way I can do this by making a script.
You could use Grep or Sed. set var `grep "(#===========whitelist start=======================)(.*)(#===========whitelist end=======================)" ` should give you a good starting point. -- Registered Linux Addict #431495 http://profile.xfire.com/mrstalinman | John 3:16! http://www.fsdev.net/ | http://www.fsdev.net/~cmiller Josh Billings - "Every man has his follies - and often they are the most interesting thing he has got." - http://www.brainyquote.com/quotes/authors/j/josh_billings.html --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Linux Users Group. To post a message, send email to [email protected] To unsubscribe, send email to [email protected] For more options, visit our group at http://groups.google.com/group/linuxusersgroup -~----------~----~----~----~------~----~------~--~---
