On 0, Guillaume CHARDIN <[email protected]> wrote:
> Hi,
>
> In a backup process of some xen virtual machine, i need to extract in
> the config file some informations (in fact the disk line) .
> The line look like this :
> disk = [ file:/path/to/file,sda1,w ]
> my goal is to isolate le `file` part to use it later. I'm a beginner
> with sed/grep and [...]
I know this isn't the answer you were looking for, but here is an easy way to
isolate it in Perl;
$string = "disk = [ file:/path/to/file,sda1,w ]";
$string =~ s/^.+://;
$string =~ s/ ]$//;
($path,$name,$perms) = split(",", $string);
--
http://fuzzydev.org/~pobega
http://identi.ca/pobega
--
To UNSUBSCRIBE, email to [email protected]
with a subject of "unsubscribe". Trouble? Contact [email protected]