On 2009-10-19 16:34, Gene Heskett wrote:
On Monday 19 October 2009, Dustin J. Mitchell wrote:
On Mon, Oct 19, 2009 at 8:05 AM, Gene Heskett <gene.hesk...@verizon.net>
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
In portable shell, there must be space before and after the '[' and ']'
as well as before and after the comparison operator.
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!
--
Paul Bijnens, Xplanation Technology Services Tel +32 16 397.525
Interleuvenlaan 86, B-3001 Leuven, BELGIUM Fax +32 16 397.552
***********************************************************************
* I think I've got the hang of it now: exit, ^D, ^C, ^\, ^Z, ^Q, ^^, *
* quit, ZZ, :q, :q!, M-Z, ^X^C, logoff, logout, close, bye, /bye, ~., *
* stop, end, ^]c, +++ ATH, disconnect, halt, abort, hangup, KJOB, *
* ^X^X, :D::D, kill -9 1, kill -1 $$, shutdown, init 0, Alt-F4, *
* Alt-f-e, Ctrl-Alt-Del, Alt-SysRq-reisub, Stop-A, AltGr-NumLock, ... *
* ... "Are you sure?" ... YES ... Phew ... I'm out *
***********************************************************************