Imported Upstream version 4.5.14
[platform/upstream/findutils.git] / find / testsuite / test_escape_c.sh
1 #! /bin/sh
2 testname="$(basename $0)"
3
4 . "${srcdir}"/binary_locations.sh
5
6 goldenfile="${srcdir}/test_escapechars.golden"
7 expected='hello^.^world'
8
9 for executable in "$oldfind" "$ftsfind"
10 do
11     if result="$($executable . -maxdepth 0 \
12             -printf 'hello^\cthere' \
13             -exec printf %s {} \; \
14             -printf '^world\n' )"; then
15         if [[ "${result}" != "${expected}" ]]; then
16             exec >&2
17             echo "$executable produced incorrect output:"
18             echo "${result}"
19             echo "Expected output was:"
20             echo "${expected}"
21             exit 1
22         fi
23     else
24         echo "$executable returned $?" >&2
25         exit 1
26     fi
27 done