I have the output of a bash command:
8.8.8.8#53 google-public-dns-a.google.com. A
I would like to add to the bash command a regex expression to remove from the # to the next space, for the desired output of:
8.8.8.8 google-public-dns-a.google.com. A
I have tried piping the output to sed 's/#.*?\s//'
(which in theory would also remove the trailing space, but this is acceptable), but output remains the same as the original.
Any suggestion on how to achieve the desired output?