diff options
author | Tavian Barnes <tavianator@tavianator.com> | 2025-02-07 14:40:50 -0500 |
---|---|---|
committer | Tavian Barnes <tavianator@tavianator.com> | 2025-02-07 14:40:50 -0500 |
commit | 069b203617ca643b94122e41d34699c4f2ef949e (patch) | |
tree | addba5eb2b53a15c06addec810af97453649e49d /tests | |
parent | 232a140327e3e6b8cb1699c526e2ea1c0decc68a (diff) | |
download | bfs-069b203617ca643b94122e41d34699c4f2ef949e.tar.xz |
tests: Don't shell out to tr just to replace slashes with dashes
Diffstat (limited to 'tests')
-rw-r--r-- | tests/color.sh | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/tests/color.sh b/tests/color.sh index 8447824..9e2e0f6 100644 --- a/tests/color.sh +++ b/tests/color.sh @@ -46,9 +46,7 @@ show_bar() { # Name the pipe deterministically based on the ttyname, so that concurrent # tests.sh runs on the same terminal (e.g. make -jN check) cooperate - local pipe - pipe=$(printf '%s' "$TTY" | tr '/' '-') - pipe="${TMPDIR:-/tmp}/bfs$pipe.bar" + local pipe="${TMPDIR:-/tmp}/bfs${TTY//\//-}.bar" if mkfifo "$pipe" 2>/dev/null; then # We won the race, create the background process to manage the bar |