Packages

A wildcard matching library that implements unix-style blob pattern matching functionality for Elixir binaries. It works on all binary input and defaults to working with codepoint representations of binaries, but other modes are also available.

Current section

Files

Jump to
wild priv wildcard_test.sh
Raw

priv/wildcard_test.sh

#! /bin/bash
## Created for development/testing
##
## Example Usage:
## ./wildcard_test.sh "foobar" "fooba*"
subject=${1?No subject}
pattern=${2?No pattern}
option=$3
if [[ $option == "-v" ]]; then
echo "subject: $subject"
echo -n $subject | od -An -tuC | xargs
echo "pattern: $pattern"
echo -n $pattern | od -An -tuC | xargs
fi
case $subject in
($pattern) echo "match"; true;;
(*) echo "no match"; false;;
esac