Amanda-Users

Re: Another oddity from Gene

2009-10-19 11:07:41
Subject: Re: Another oddity from Gene
From: "Dustin J. Mitchell" <dustin AT zmanda DOT com>
To: Gene Heskett <gene.heskett AT verizon DOT net>
Date: Mon, 19 Oct 2009 10:57:16 -0400
On Mon, Oct 19, 2009 at 10:34 AM, Gene Heskett <gene.heskett AT verizon DOT 
net> wrote:
> I'll try that, but IIRC if the dir is empty, ls still returns a linefeed.
> brb.
> Nope, tried with !='' and !='\n', with almost the same result, the diff being
> that now the error message on the console is minus the ending ] now.
>
> ./flush.sh: line 173: [20091019011512: command not found

The whitespace is significant in the command I showed:

if [ `/bin/ls /dumps` != "" ]

btw, the shell strips leading and trailing whitespace, so don't worry
about the newline.

Dustin

-- 
Open Source Storage Engineer
http://www.zmanda.com

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