Pattern extraction - Help !

8 views
Skip to first unread message

Sergio AFANOU

unread,
Dec 7, 2011, 3:45:04 PM12/7/11
to project...@googlegroups.com
Hello all,

I'm struggling since last week to extract some text from the configuration files. I think you guys are better than me at bash + regexp.

I need to extract the config values from a configuration file. For example, I have a config file (I modified my configuration to be able to sync multiple directories): 


----   lipsync.lua

sync{
          default.rsyncssh, 
          source="/home/sergio/lipsync/", 
          host="ser...@myhome.server.example.com", 
          targetdir="/home/sergio/lipsync/", 
          rsyncOpts="-ltusravC", 
          offline=true
          init=false
}

sync{
          default.rsyncssh, source="/home/sergio/bright/", 
          host="ser...@myhome.server.example.com", targetdir="/home/sergio/bright/", 
          offline=true
          rsyncOpts="-ltusravC", init=false
}

---- end

I need to be able to extract the "source", "host", "target", "offline" and "rsyncOpts" values to trigger a sync event when back online.

Can you help me ?

Thanks in advance.
Sergio
Reply all
Reply to author
Forward
0 new messages