I have file named user.rb as like:
class User < ApplicationRecord end I want to add a new line and after adding line it will look :
class User < ApplicationRecord include Company end But I want to add this additional line from bash script or terminal. I tried it with this bash code:
sed -i '' 's/end/include Company\n\end/' app/models/user.rb But it does not return new line after adding line. Please help me.