From 35821cdbf463543b91f7fdf6c4de9f056fc6d8d0 Mon Sep 17 00:00:00 2001 From: Mark McDonald Date: Fri, 7 Jun 2019 15:06:59 +0800 Subject: [PATCH] Allow searches beginning with `--` Without telling grep that we've finished providing arguments, the search query will be interpreted as an argument to grep. --- scripts/copycat_generate_results.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/copycat_generate_results.sh b/scripts/copycat_generate_results.sh index c5f94dc..c7662a5 100755 --- a/scripts/copycat_generate_results.sh +++ b/scripts/copycat_generate_results.sh @@ -17,7 +17,7 @@ reverse_and_create_copycat_file() { local file=$1 local copycat_file=$2 local grep_pattern=$3 - (tac 2>/dev/null || tail -r) < "$file" | grep -oniE "$grep_pattern" > "$copycat_file" + (tac 2>/dev/null || tail -r) < "$file" | grep -oniE -- "$grep_pattern" > "$copycat_file" } delete_old_files() {