Try this syntax, see if it helps
if [ `stat -c%s $olddump` -eq `stat -c%s $newdump`] I think that is doing what you want it to do. -Greg >>>>> "John" == John Mort <[EMAIL PROTECTED]> writes: John> I'm trying to write a script that will dump one of my databases, then John> check to see if anything has changed since the last time the script John> ran (the idea being to remove duplicate backups to save disk space). John> Using cmp isn't an option because apparently some small number of bits John> are always changing so each dump is "unique". So I'm trying to just John> compare the file sizes, but I'm apparently doing something wrong. Any John> help would be appreciated. John> The code: John> if $(stat -c%s $olddump) -eq $(stat -c%s $newdump) John> then John> echo No changes. John> else John> echo File has changed. John> fi John> The error: John> $ sh foo.shell John> foo.shell: 25: 875479: not found John> Backing up changes. John> Right now the files are equal size, so it should say "No changes." John> 875479 is the size of the files. I've tried dumping the stat command John> results into variables and comparing the variables, but I still get John> this same error message. My googlemancy isn't powerful enough to come John> up with the answer on my own. :-/ John> -- John> John D. Mort John> http://john.mort.net John> _______________________________________________ John> Mid-Hudson Valley Linux Users Group http://mhvlug.org John> http://mhvlug.org/cgi-bin/mailman/listinfo/mhvlug John> Upcoming Meetings (6pm - 8pm) MHVLS Auditorium John> Feb 6 - DBUS John> Mar 5 - Setting up a platform-independent home/small office network using Linux -- Greg Priest-Dorman [EMAIL PROTECTED] _______________________________________________ Mid-Hudson Valley Linux Users Group http://mhvlug.org http://mhvlug.org/cgi-bin/mailman/listinfo/mhvlug Upcoming Meetings (6pm - 8pm) MHVLS Auditorium Feb 6 - DBUS Mar 5 - Setting up a platform-independent home/small office network using Linux
