#!/bin/sh
set -eu
-# Copyright 2017 The Rust Project Developers. See the COPYRIGHT
-# file at the top-level directory of this distribution and at
-# http://rust-lang.org/COPYRIGHT.
-#
-# Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
-# http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
-# <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
-# option. This file may not be copied, modified, or distributed
-# except according to those terms.
-
# Performs `cat` and `grep` simultaneously for `run-make` tests in the Rust CI.
#
# This program will read lines from stdin and print them to stdout immediately.
shift $((OPTIND - 1))
+# use gnu version of tool if available (for bsd)
+if command -v "g${GREPPER}"; then
+ GREPPER="g${GREPPER}"
+fi
+
LOG=$(mktemp -t cgrep.XXXXXX)
trap "rm -f $LOG" EXIT