0

I have a file(sample.txt) with below content in the unix server.

--password xyzabcdef --username

I want to find the text xyzabcdef and replace it with xxxxxxxxx using sed. xyzabcdef is just a sample text, everytime the text and length of the text can change, and hence no hardcoding of the text.

Note: --password --username text is standard and wont change. I just want to find the text between these two and replace it.

expected result

--password xxxxxxxxx --username
Barmar
  • 741,623
  • 53
  • 500
  • 612

0 Answers0