1#!/bin/sh
2# test -e cef2 switch
3PATH=/bin:/usr/bin
4DBACL=$TESTBIN/dbacl
5
6prerequisite_command() {
7    type $2 2>&1 > /dev/null
8    if [ 0 -ne $? ]; then
9        echo "$1: $2 not found, test will be skipped"
10        exit 77
11    fi
12}
13
14prerequisite_command $0 grep
15
16DBACL_PATH="`pwd`/`basename $0 .sh`_`date +"%Y%m%dT%H%M%S"`"
17export DBACL_PATH
18
19exit 0
20
21mkdir "$DBACL_PATH"
22
23echo '123 xyz Hello234%*# +123' \
24    | $DBACL -l dummy -e cef2
25head -3 "$DBACL_PATH/dummy" \
26    | grep '# hash_size 15 features 6 unique_features 5 documents 0' \
27    > /dev/null
28
29RESULT=$?
30rm -rf "$DBACL_PATH"
31
32exit $RESULT