On Monday 19 October 2009, Dustin J. Mitchell wrote: >On Mon, Oct 19, 2009 at 10:34 AM, Gene Heskett <gene.hesk...@verizon.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` != "" ] > Except that this time you use dbl-quotes. I used singles as you did in the first reply, and it worked, with the added white space around the [ and ] as Paul pointed out.
It may be that due to a proportionally spaced font here, that I missed that white space detail. Which is the most correct? '' or "" >btw, the shell strips leading and trailing whitespace, so don't worry >about the newline. ISTR reading as much, but CRS is becoming an issue. :) >Dustin > Thanks again. -- Cheers, Gene "There are four boxes to be used in defense of liberty: soap, ballot, jury, and ammo. Please use in that order." -Ed Howdershelt (Author) The NRA is offering FREE Associate memberships to anyone who wants them. <https://www.nrahq.org/nrabonus/accept-membership.asp> In the force if Yoda's so strong, construct a sentence with words in the proper order then why can't he?