Hi I have a doubt, here if a file does not have the write permissions to the root user my script is going to write the data into that file. when i executed the script as root user. Is it correct ... ?
Yes, root can do pretty much anything.
In most cases, yes.
However, root cannot write to a write protected file if the filesystem is mounted read-only or is remote (NFS).
And same applies for transferring of files remotely as root directly, could be also disabled in some cases
Ok Thanks...