#!/bin/bash

mkdir -p /tmp/test/dir/{one,two}
echo test > /tmp/test/dir/one/file
echo test > /tmp/test/dir/two/file

echo "Test 1"
/bin/grep test -r /tmp/test/dir

echo -e "\nTest 2"
/bin/grep test --exclude-dir="one" -r /tmp/test/dir

echo -e "\nTest 3"
/bin/grep test --exclude-dir="*one*" -r /tmp/test/dir

echo -e "\nTest 4"
/bin/grep test --exclude-dir="*/one" -r /tmp/test/dir

echo -e "\nTest 5"
/bin/grep test --exclude-dir="*/one/*" -r /tmp/test/dir

echo -e "\nTest 6"
/bin/grep test --exclude-dir="*/one*" -r /tmp/test/dir

echo -e "\nTest 7"
/bin/grep test --exclude-dir="*dir/one*" -r /tmp/test/dir

echo -e "\nTest 8"
/bin/grep test --exclude-dir="*/dir/one*" -r /tmp/test/dir

echo -e "\nTest 9"
/bin/grep test --exclude-dir="*/dir/one/*" -r /tmp/test/dir

echo -e "\nTest 10"
/bin/grep test --exclude-dir="*/dir/one/*" -r /tmp/test

echo -e "\nTest 11"
/bin/grep test --exclude-dir="dir/one" -r /tmp/test

echo -e "\nTest 12"
/bin/grep test --exclude-dir="*dir/one*" -r /tmp/test
