2 # Ensure that cat -E produces same output as cat, module `$'s,
3 # even when applied to a file in /proc.
5 if test "$VERBOSE" = yes; then
11 t0=`echo "$0"|sed 's,.*/,,'`.tmp; tmp=$t0/$$
12 trap 'status=$?; cd $pwd; chmod -R u+rwx $t0; rm -rf $t0 && exit $status' 0
13 trap '(exit $?); exit $?' 1 2 13 15
16 mkdir -p $tmp || framework_failure=1
17 cd $tmp || framework_failure=1
19 if test $framework_failure = 1; then
20 echo "$0: failure in testing framework" 1>&2
27 echo "$0: no $f skipping this test" 1>&2
33 # Yes, parts of /proc/cpuinfo might change between cat runs.
34 # If that happens, consider choosing a file that's less likely to change,
35 # or just filter out the changing lines.
36 cat -E $f | tr -d '$' > out || fail=1
37 cat $f | tr -d '$' > exp || fail=1
40 test $fail = 1 && diff out exp 2> /dev/null
42 (exit $fail); exit $fail