2010-05-11 01:53:57 +00:00
|
|
|
# FEATURE: CONFIG_FEATURE_TR_CLASSES
|
|
|
|
|
2006-04-19 22:22:06 +00:00
|
|
|
run_tr ()
|
|
|
|
{
|
2010-05-12 13:59:32 +00:00
|
|
|
$ECHO -n "echo '$1' | tr '$2' '$3': "
|
2006-04-19 22:22:06 +00:00
|
|
|
echo "$1" | $bb tr "$2" "$3"
|
|
|
|
echo
|
|
|
|
}
|
|
|
|
tr_test ()
|
|
|
|
{
|
|
|
|
run_tr "cbaab" abc zyx
|
2006-09-17 16:28:10 +00:00
|
|
|
run_tr "TESTING A B C" '[A-Z]' '[a-z]'
|
2006-04-19 22:22:06 +00:00
|
|
|
run_tr "abc[]" "a[b" AXB
|
|
|
|
run_tr abc '[:alpha:]' A-ZA-Z
|
|
|
|
run_tr abc56 '[:alnum:]' A-ZA-Zxxxxxxxxxx
|
|
|
|
run_tr 012 '[:digit:]' abcdefghi
|
|
|
|
run_tr abc56 '[:lower:]' '[:upper:]'
|
|
|
|
run_tr " " '[:space:]' 12345
|
|
|
|
run_tr " " '[:blank:]' 12
|
|
|
|
run_tr 'a b' '[= =]' X
|
|
|
|
run_tr "[:" '[:' ab
|
2007-03-30 14:43:27 +00:00
|
|
|
run_tr " .,:" '[:punct:]' 12
|
|
|
|
run_tr " .,:" '[:cntrl:]' 12
|
2006-04-19 22:22:06 +00:00
|
|
|
}
|
2004-04-06 11:10:30 +00:00
|
|
|
|
2006-04-19 22:22:06 +00:00
|
|
|
bb= tr_test > logfile.gnu
|
|
|
|
bb=busybox tr_test > logfile.bb
|
2007-03-30 14:43:27 +00:00
|
|
|
diff -u logfile.gnu logfile.bb
|