I am removing keys from a config file by the following command:
cat showrunningconfig.txt | grep -v '[ \t\r\n\v\f]*[A-Fa-f0-9][A-Fa-f0-9][A-Fa-f0-9][A-Fa-f0-9][A-Fa-f0-9][A-Fa-f0-9][A-Fa-f0-9][A-Fa-f0-9]' This removes the whole line. But I want to remove only the relevant patterns. grep has the -o option, which shows only the relevant pattern and not the whole line. But the -o option is not working in combination with -v
Any idea? Thanks a lot!
sedfor that.LC_ALL=C sed -i 's/[[:space:]]*[A-Fa-f0-9]\{8\}//g' showrunningconfig.txt[[:xdigit:]]instead of[A-Fa-f0-9].