Made BSD diff compatible
[pspp] / tests / command / sysfile-info.sh
index 4f08b16627fd1f31177910c72c462c2a0afd657b..097a9c831761ce8f32e2d5f290d3b74ec03eab1f 100755 (executable)
@@ -10,7 +10,8 @@ here=`pwd`;
 # ensure that top_srcdir is absolute
 cd $top_srcdir; top_srcdir=`pwd`
 
-export STAT_CONFIG_PATH=$top_srcdir/config
+STAT_CONFIG_PATH=$top_srcdir/config
+export STAT_CONFIG_PATH
 
 
 cleanup()
@@ -19,6 +20,7 @@ cleanup()
        echo "NOT cleaning $TEMPDIR"
        return ; 
      fi
+     cd /
      rm -rf $TEMPDIR
 }
 
@@ -70,11 +72,11 @@ $SUPERVISOR $here/../src/pspp --testing-mode -o raw-ascii $TESTFILE
 if [ $? -ne 0 ] ; then no_result ; fi
 
 activity="filter output"
-grep -v '^Created: ' $TEMPDIR/pspp.list > $TEMPDIR/out-filtered
+egrep -v '^(Created|Endian): ' $TEMPDIR/pspp.list > $TEMPDIR/out-filtered
 if [ $? -ne 0 ] ; then no_result ; fi
 
 activity="compare output"
-diff $TEMPDIR/out-filtered - << EOF
+diff -b -B -w $TEMPDIR/out-filtered - << EOF
 1.1 DATA LIST.  Reading free-form data from the command file.
 +--------+------+
 |Variable|Format|
@@ -86,7 +88,6 @@ diff $TEMPDIR/out-filtered - << EOF
 2.1 SYSFILE INFO.  
 File:      pro.sav
 Label:     No label.
-Endian:    Little.
 Variables: 2
 Cases:     3
 Type:      System File.