Executing command as a root.
Correcting problem with new line character and using tee instead of pipe