0

Let's say I have a file named 'newfile' . Now I do some text substitution using sed command

sed 's/text1/text2/' newfile > newfile

In the above command I am subsituting text1 with text2 and then redirecting the output to the samefile. However after executing this command when I use

cat newfile

An empty file is showed.

What's the problem here?

Jeff Schaller
  • 66,199
  • 35
  • 114
  • 250
Kishan Kumar
  • 125
  • 2
  • 9

0 Answers0