sh: Add simple tests for set -x and PS4.

This commit is contained in:
Jilles Tjoelker 2011-06-08 21:58:19 +00:00
parent 9fe1fe8204
commit 725cc7854e
2 changed files with 17 additions and 0 deletions

View File

@ -0,0 +1,8 @@
# $FreeBSD$
key='must_contain_this'
{ r=`set -x; { : "$key"; } 2>&1 >/dev/null`; } 2>/dev/null
case $r in
*"$key"*) true ;;
*) false ;;
esac

View File

@ -0,0 +1,9 @@
# $FreeBSD$
key='must contain this'
PS4="$key+ "
{ r=`set -x; { :; } 2>&1 >/dev/null`; } 2>/dev/null
case $r in
*"$key"*) true ;;
*) false ;;
esac