I have a shell script (myfile.ksh) file which will have sequence of command.
Somewhere there will be a command to replace this myfile.ksh with new file.
I studied that inside my myfile.ksh, I can start a new process with &.
. newfiletocopy.ksh &
I have put lot of effort to copy & replace the own file.
Is there any better way to achieve this?
exec, but it is for advanced usage. If you can't describe in simple language what use-case requirement is, you probably don't need exec. Good luck!