view build-aux/find-files-with-tests.sh @ 16132:43e6415393ff

build: check for grep in configure and then use it in build process. * configure.ac: Add call to AC_PROG_GREP. * build-aux/common.mk: substitute environment variable GREP with value from configure. Use $(GREP) in commands. * build-aux/find-files-with-tests.sh: use $(GREP) instead of grep in commands.
author Rik <rik@octave.org>
date Tue, 26 Feb 2013 16:52:33 -0800
parents 98fc95793699
children
line wrap: on
line source

#! /bin/sh

set -e
GREP=${GREP:-grep}
SED=${SED:-sed}

srcdir="$1"
shift

for arg
do
  if [ -f "$arg" ]; then
    file="$arg"
  else
    file="$srcdir/$arg"
  fi
  if [ "`$GREP -l '^%!' $file`" ]; then
    echo "$file" | $SED "s,\\$srcdir/,,";
  fi
done