Made tests BSD diff compatible
[pspp] / tests / command / filter.sh
index 905d21aeaf785b97dd53f5fada95a858b5393bb2..b6ab48f046e202f58522152443873e1c5e3fa6ea 100755 (executable)
@@ -10,11 +10,13 @@ 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()
 {
+     cd /
      rm -rf $TEMPDIR
 }
 
@@ -48,7 +50,7 @@ cd $TEMPDIR
 
 activity="create program"
 cat > $TESTFILE << EOF
-data list notable /x 1-2.
+data list notable /X 1-2.
 begin data.
 1
 2
@@ -61,7 +63,7 @@ begin data.
 9
 10
 end data.
-compute filter_$ = mod(x,2).
+compute FILTER_$ = mod(x,2).
 
 filter by filter_$.
 list.
@@ -81,7 +83,8 @@ if [ $? -ne 0 ] ; then no_result ; fi
 
 
 activity="check results"
-diff -B -b $TEMPDIR/pspp.list - << EOF
+perl -pi -e s/^\s*\$//g $TEMPDIR/pspp.list
+diff  -b $TEMPDIR/pspp.list - << EOF | perl -e 's/^\s*$//g'
  X FILTER_$
 -- --------
  1     1.00