On Monday 19 October 2009, Dustin J. Mitchell wrote: >On Mon, Oct 19, 2009 at 8:05 AM, Gene Heskett <[email protected]> wrote: >> if [`/bin/ls /dumps`]; then <<<<<----line 173 > >This can be a bit tricky in portable shell, but maybe this is closer >to what you want: > >if [ `/bin/ls /dumps` != '' ] > >Dustin
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 I fail to see why bash is looking for that ls return as a command to be executed, almost like bash is busted, and its been ages since bash was updated. This script has worked many times since the last time I saw a bash update go by. its enough to make a fellow wish it was beer-thirty and I haven't even finished my first cup of tea! -- 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> DON'T go!! I'm not HOWARD COSELL!! I know POLISH JOKES ... WAIT!! Don't go!! I AM Howard Cosell! ... And I DON'T know Polish jokes!!
