On Wed, Feb 11, 2004 at 11:36:45PM +0100, Werner Mahr wrote: > -----BEGIN PGP SIGNED MESSAGE----- > Hash: SHA1 > > Am Mittwoch, 11. Februar 2004 18:49 schrieb Keith Nasman: > > > CONFFILE="/floppy/aide/aide.conf" > > DATABASE=`grep "^database=file:/" $CONFFILE | head -1 | cut -d: > > -f2` [ -z "$DATABASE" ] && DATABASE="/var/lib/aide/aide.db" > > > > > > So the conf file path is correct. The second line parses > > database=file:/floppy/aide/aide.db to "/floppy/aide/aide.db" which > > is correct. The third line gets a bit beyond my knowledge of bash > > scripting, I assume it means that if the file the $DATABASE > > variable points to doesn't exist, then set $DATABASE to > > /var/lib/aide/aide.db. > > I don't know regex, but I know, If you do an && between two commands, > the second is executed if the first is ok. This means if Database > exists, set the variable to the other Path. > > You can do: > > [ -z "$DATABASE" ] || DATABASE="/var/lib/aide/aide.db" > > or > > [ -z ! "$DATABASE" ] && DATABASE="/var/lib/aide/aide.db" > > I think the first would be better, but I`m drunken. >
Tried both with no success. Keith -- To UNSUBSCRIBE, email to [EMAIL PROTECTED] with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]