bin: Add no-ansi to remove ANSI escape sequences

Similar to `no-ansi-sgr` but removes all ANSI escape sequence, not just
the SGR ones.

See the previous commit bbf9a1da58 (bin:no-ansi-sgr: Set LC_ALL=C for
`[0-?]` range, 2025-07-30) for an explanation of why LC_ALL has to be
set.
This commit is contained in:
2025-07-30 17:35:51 +02:00
parent bbf9a1da58
commit 8380d4cc29

7
.local/bin/no-ansi Executable file
View File

@@ -0,0 +1,7 @@
#!/bin/sh
# SPDX-License-Identifier: MIT
# Copyright (c) 2025 Julian Prein
#
# Remove ANSI escape sequences.
env LC_ALL=C sed 's/\[[0-?]*[ -/]*[@-z]//g'