hppt icon indicating copy to clipboard operation
hppt copied to clipboard

eq should be -eq in archive_wal

Open gkwrcc opened this issue 12 years ago • 1 comments

diff --git a/rep/archive_wal b/rep/archive_wal
index 8e98b38..12f0219 100755
--- a/rep/archive_wal
+++ b/rep/archive_wal
@@ -158,7 +158,7 @@ fi
 # 16MB WAL files have no "." in their name at all.

 DOTPOS=`expr index "$2" "."`
-if [ $DOTPOS eq 0 ] ; then
+if [ $DOTPOS -eq 0 ] ; then
   # No dot in the file, must be a regular WAL file.
   # Sanity check on file size, to never copy a partial WAL file
   FILESIZE=$(du -b "$1" | cut -f 1)

gkwrcc avatar Oct 24 '13 22:10 gkwrcc

After trying to fix this as suggested, I discovered "expr index" only works on systems with GNU coreutils. OS X for example gives an error. I want to get a more robust fix for this before committing a change that might break some working installations of archive_wal.

gregs1104 avatar Jun 02 '15 18:06 gregs1104