Hi all,
This is my 3rd post in the process of learning sed. I have a hypothetical requirement. I want to be able to replace 3rd word in each line by 'was', where words are delimited by space(s).
bash$ cat words
hi this is me here
hi this is me again
hi this is me yet again
hi this is me
Desired output:
hi this was me here
hi this was me again
hi this was me yet again
hi this was me
Could people please help with how to do it with sed. I tried a few executing instructions, but didn't work. Thanks,
Jagrati
I found it! I found it!
Okay, I got the right instruction at last. This works:
sed -e 's/[^ ]*[^ ]/was/3' words