Issue
I need to modify a file in a Docker image. I would like to change the line 2357 of a Python module mod.py
with sed, how can I do that ?
raise ExchangeError(self.id + ' ' + errorText + '(#' + errorCode + ')')
The desired output would be:
raise ExchangeError(self.id + '(#' + errorCode + ')')
or
raise ExchangeError(self.id)
Solution
Try it with:
sed -i "2357s/+ ' ' + errorText //" path/mod.py
Answered By - Peter Kuilboer Answer Checked By - David Goodson (WPSolving Volunteer)