sed replace all tabs and spaces with a single space

Use sed -e “s/[[:space:]]\+/ /g” Here’s an explanation: [ # start of character class [:space:] # The POSIX character class for whitespace characters. It’s # functionally identical to [ \t\r\n\v\f] which matches a space, # tab, carriage return, newline, vertical tab, or form feed. See # https://en.wikipedia.org/wiki/Regular_expression#POSIX_character_classes ] # end of character class \+ # … Read more

dig show only answer

I am not sure why you are getting comments in the output. That is the correct set of options for the behaviour you want. Here are the same options with the same version of dig: $ dig -version DiG 9.7.3 $ dig +noall +answer google.de google.de. 55 IN A 173.194.44.216 google.de. 55 IN A 173.194.44.223 … Read more