BackupPC-users

Re: [BackupPC-users] Why does $share work but not ${share} in DumpPreShareCmd

2009-11-10 02:43:18
Subject: Re: [BackupPC-users] Why does $share work but not ${share} in DumpPreShareCmd
From: "Jeffrey J. Kosowsky" <backuppc AT kosowsky DOT org>
To: General list for user discussion <backuppc-users AT lists.sourceforge DOT net>
Date: Tue, 10 Nov 2009 02:40:21 -0500
Craig Barratt wrote at about 22:49:09 -0800 on Monday, November 9, 2009:
 > Jeffrey writes:
 > 
 > > Specifically, the following works
 > > $Conf{DumpPreShareCmd}    = 'mycommand $share $share/myfile';
 > > And indeed $share is substituted properly.
 > > but the following does not...
 > > $Conf{DumpPreShareCmd}    = 'mycommand $share ${share}/myfile';
 > > And instead it passes ${share} for the final argument.
 > > I would have thought that the braces would be treated properly whether
 > > in a perl or bash script.
 > 
 > The variable substitution is done via regular expressions, not
 > by perl eval().  The perl brace syntax isn't supported, although
 > you could add it pretty easily.

Thanks - that is good to know and maybe should be documented. Given
that much of the rest of the conf file takes arbitrary perl code, it
wasn't obvious to me that we were leaving the perl paradigm here.

It may be even better to add if it is pretty easy, since at least when
I see the $<variable>, I'm usually thinking either perl or bash
variables - both of which recognize the brace construction. So that
would eliminate such hopefully understandable confusion.

------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day 
trial. Simplify your report design, integration and deployment - and focus on 
what you do best, core application coding. Discover what's new with
Crystal Reports now.  http://p.sf.net/sfu/bobj-july
_______________________________________________
BackupPC-users mailing list
BackupPC-users AT lists.sourceforge DOT net
List:    https://lists.sourceforge.net/lists/listinfo/backuppc-users
Wiki:    http://backuppc.wiki.sourceforge.net
Project: http://backuppc.sourceforge.net/

<Prev in Thread] Current Thread [Next in Thread>