Re: [Bacula-users] Shell script question.

2010-03-04 Thread Russell Sutherland
Why would you do this: if [ "x$var" = "x" ]; then ... fi The above shell programming construct is ancient, well tested and reliable as it works on the various flavours of the Bourne/Korn/Bash shells. Keep it simple. --- Russell P. Sutherland Email: russ @ madhaus.cns.utoront

Re: [Bacula-users] Shell script question.

2010-03-04 Thread Martin Simmons
> On Thu, 4 Mar 2010 14:47:47 +0100, Marc Schiffbauer said: > Mail-Followup-To: bacula-users@lists.sourceforge.net > > * Martin Simmons schrieb am 04.03.10 um 11:40 Uhr: > > > On Thu, 4 Mar 2010 03:41:36 +0100, Marc Schiffbauer said: > > > > > > Why not use > > > > > > if [ "$var" = "

Re: [Bacula-users] Shell script question.

2010-03-04 Thread Phil Stracchino
On 03/04/10 08:47, Marc Schiffbauer wrote: > Thx Martin, I did not know this. Is it only "!" because of some job > control stuff or everything that is not [:alnum:]? Other problematic metacharacters exist. Basically any character that has special meaning to the shell is potentially problematic in

Re: [Bacula-users] Shell script question.

2010-03-04 Thread Marc Schiffbauer
* Martin Simmons schrieb am 04.03.10 um 11:40 Uhr: > > On Thu, 4 Mar 2010 03:41:36 +0100, Marc Schiffbauer said: > > > > * Phil Stracchino schrieb am 03.03.10 um 20:18 Uhr: > > > On 03/03/10 14:05, Brian Debelius wrote: > > > > Hi, > > > > > > > >Looking at Bacula scripts and other script

Re: [Bacula-users] Shell script question.

2010-03-04 Thread Martin Simmons
> On Thu, 4 Mar 2010 03:41:36 +0100, Marc Schiffbauer said: > > * Phil Stracchino schrieb am 03.03.10 um 20:18 Uhr: > > On 03/03/10 14:05, Brian Debelius wrote: > > > Hi, > > > > > >Looking at Bacula scripts and other scripts, I see a test for an > > > empty string performed by adding an

Re: [Bacula-users] Shell script question.

2010-03-04 Thread Kevin Keane
acula-users@lists.sourceforge.net; ca...@unknownlamer.org > Subject: [Bacula-users] Shell script question. > > Hi, > >Looking at Bacula scripts and other scripts, I see a test for an > empty string performed by adding an 'x' before the variable, and then > comparin

Re: [Bacula-users] Shell script question.

2010-03-03 Thread Marc Schiffbauer
* Phil Stracchino schrieb am 03.03.10 um 20:18 Uhr: > On 03/03/10 14:05, Brian Debelius wrote: > > Hi, > > > >Looking at Bacula scripts and other scripts, I see a test for an > > empty string performed by adding an 'x' before the variable, and then > > comparing this to another string that i

Re: [Bacula-users] Shell script question.

2010-03-03 Thread Mike Eggleston
On Wed, 03 Mar 2010, Brian Debelius might have said: > Hi, > >Looking at Bacula scripts and other scripts, I see a test for an > empty string performed by adding an 'x' before the variable, and then > comparing this to another string that is just an 'x'. > >The shell test function has

Re: [Bacula-users] Shell script question.

2010-03-03 Thread Phil Stracchino
On 03/03/10 14:05, Brian Debelius wrote: > Hi, > >Looking at Bacula scripts and other scripts, I see a test for an > empty string performed by adding an 'x' before the variable, and then > comparing this to another string that is just an 'x'. > >The shell test function has a -z string t

[Bacula-users] Shell script question.

2010-03-03 Thread Brian Debelius
Hi, Looking at Bacula scripts and other scripts, I see a test for an empty string performed by adding an 'x' before the variable, and then comparing this to another string that is just an 'x'. The shell test function has a -z string test that returns true if the string is empty. It appe