This is my third post in the process of learning sed. I have a hypothetical requirement. I want to be able to replace the third word in each line with "was", where the words are limited to a space.
bash$ cat words
hi this is me here
hi this is me again
hi this is me yet again
hi this is me
Required Conclusion:
hi this was me here
hi this was me again
hi this was me yet again
hi this was me
Can people help with how to do this with sed. I tried a few instructions but did not work. Thank,
Jagrati
I found him! I found him!
Well, finally, I got the correct instruction. It works:
sed -e 's/[^ ]*[^ ]/was/3' words
source
share