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
> 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" = "
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
* 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
> 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
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
* 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
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
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
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
10 matches
Mail list logo