Hello I have a file called users. In that file i have a list of users for example
user1
user2
user3
Now i have another file called searches where there is a specific string called owner = user for example
owner = user1
random text
random text
owner = user15
random text
random text
owner = user2
so is it possible to find all the users based on the users file and rename those users to [email protected] ? for example
owner = [email protected]
random text
random text
owner = user15
random text
random text
owner = [email protected]
i got some bits and pieces working using the ack command and the cat command but i am new to programming so i cant get a proper output. What i figured out is below but it does not really do what i need. any help is highly appreciated.
cat users | xargs -i sed 's/{}/moo/' searches