Created
July 31, 2022 09:20
-
-
Save zhum/8def41e2dcd4aaa067099e352061e5a8 to your computer and use it in GitHub Desktop.
awk replacement sample
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
# replace "Nodename=abc Uptime=1 CPUs=128 State=Drain Reason=no cpu detected [12:00]" -> "abc: no cpu detected" | |
gawk '{print gensub(/NodeName=([[:alnum:]]+).*Reason=([^[]+)\[.*/, "\\1: \\2", "g") }' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment