I have a config file in multiple machines which has some duplicated strings in specific line.
Option1 value
Option2 value
Option3 value
# Option X value
# commentary lines
...
AllowList user1@ip1 user1@ip2 user2@ip3 user2@ip4 user1@ip1 user1@ip2 user2@ip3 user2@ip4 ...
...
Option Z value
In AllowList line, there are duplicate values. How to get rid of them?
I already know how to remove the duplicate values :
grep AllowList myconfig | tr ' ' '\n' | sort | uniq | xargs
But I want to do that in place, leaving other lines intact.