Rex icon indicating copy to clipboard operation
Rex copied to clipboard

Strip ANSI color from Linux ip output

Open samuelet opened this issue 4 months ago • 0 comments

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 = '' ....

samuelet avatar Sep 03 '25 09:09 samuelet