summaryrefslogtreecommitdiffhomepage
path: root/tests/scripts
diff options
context:
space:
mode:
authorSean Kurtz <seankurtz75@gmail.com>2026-11-23 11:50:17 -0600
committerSean Kurtz <seankurtz75@gmail.com>2026-11-23 11:50:17 -0600
commitb6574b2f3cb86d33d7e55985c7914dfce6dbf296 (patch)
tree22449ab76bbe49bed35b5e6c54019d2802301d6a /tests/scripts
parent2161b3c2de4eec4cc5f28cbf683f25acd3c7dbef (diff)
parenta847b938b372995762c8ab581c0be521fd2e8bcb (diff)
downloadzash-docs/logo-and-clean.tar.gz
Merge origin/main into docs/logo-and-cleandocs/logo-and-clean
Resolutions: README.md and DESIGN.md keep the new colour logo (packaging/zash-logo.svg) at width 220; the Makefile keeps main's newer shellcheck header, lists `make docs` in the usage block, and `clean` removes docs, cov and $(ZTOOLS) along with the branch's new tools.
Diffstat (limited to 'tests/scripts')
-rw-r--r--tests/scripts/bigdata.sh4
-rw-r--r--tests/scripts/wordfreq.sh6
2 files changed, 7 insertions, 3 deletions
diff --git a/tests/scripts/bigdata.sh b/tests/scripts/bigdata.sh
index 0b012d9..58410e1 100644
--- a/tests/scripts/bigdata.sh
+++ b/tests/scripts/bigdata.sh
@@ -10,8 +10,8 @@ printf '%s\n' "$big" | cksum | cut -d' ' -f1 >sum3
cmp -s sum1 sum3 && echo "command substitution intact"
n=0; while read -r a b c; do n=$((n + c)); done <data; echo "sum: $n"
printf '%s\n' "$big" | while read -r a b c; do :; done; echo "read loop: $a"
-x=$(printf '%070000d' 0 | wc -c); echo "70000 bytes: $x" | tr -s ' '
-y=$(printf '%070000d' 0 | tr 0 x | tr x y | wc -c); echo "through tr: $y" | tr -s ' '
+x=$(printf '%070000d' 0 | wc -c | tr -d ' '); echo "70000 bytes: $x" | tr -s ' '
+y=$(printf '%070000d' 0 | tr 0 x | tr x y | wc -c | tr -d ' '); echo "through tr: $y" | tr -s ' '
printf '%0100000d\n' 0 | { read -r l; echo "${#l}"; }
cat <<EOF2 | wc -c | tr -d ' '
$big
diff --git a/tests/scripts/wordfreq.sh b/tests/scripts/wordfreq.sh
index 31c5eb0..5637c0e 100644
--- a/tests/scripts/wordfreq.sh
+++ b/tests/scripts/wordfreq.sh
@@ -4,7 +4,11 @@ The quick brown fox jumps over the lazy dog.
The dog barks; the fox runs. A quick, quick fox!
TXT
normalize() {
- tr 'A-Z' 'a-z' | tr -c 'a-z\n' ' ' | tr -s ' ' '\n' | sed '/^$/d'
+ # tr's ranges and -c follow the code page's collating order, which on
+ # z/OS (EBCDIC) makes 'A-Z' 'a-z' a mapping into punctuation and
+ # leaves ';' alone. sed and the [:upper:]/[:lower:] classes do not.
+ sed 's/[^a-zA-Z]/ /g' | tr '[:upper:]' '[:lower:]' | tr -s ' ' '\n' |
+ sed '/^$/d'
}
total=0
while read -r w; do