Skip to content

Navigation Menu

Sign in
Sign up

Strip ANSI color from Linux ip output - #1654

Open
samuelet wants to merge 1 commit into
RexOps:master from
samuelet:patch-6
Open

Strip ANSI color from Linux ip output #1654
samuelet wants to merge 1 commit into
RexOps:master from
samuelet:patch-6

Conversation

@samuelet

@samuelet samuelet commented Sep 3, 2025
edited
Loading

Copy link
Copy Markdown
Contributor

On latest Debian versions the command "Ip add show" outputs color chars on interface names. This patch uses the Term::ANSIColor lib to strip them fixing garbage in keys of Rex Template vars.
To test the problem simply dump gathered infos from a Debian Trixie (with iproute2 package installed) , and check the output of key interfaces for "$__36m" word:
rex -H MyDebian-e "say dump_system_information;"
...
$__36mens192_ip = ''
$__36mlo_netmask = ''
$__36mens192_netmask = ''
....

On latest Debian versions the command "Ip add show" outputs color chars on interface names.
This patch strips them fixing garbage in keys of Rex Template vars.
samuelet deleted the patch-6 branch September 5, 2025 12:27
samuelet restored the patch-6 branch September 5, 2025 12:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

No reviews

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

1 participant

AltStyle によって変換されたページ (->オリジナル) /