Scripts fails if you change its code during the execution.

So a script is working properly (tested many times) , then you add a new fine piece of code ,finaly its fails generally with a syntax error at the last line of the script.

:confused:... does anybody why this happens?

>uname -a                                                   
HP-UX test B.11.11 U 9000/800

Thx in advance.

Would certainly help if you showed us the script. And the error it throws.

This is not a particular Issue ,in fact i noticed this behavior with different scripts, all with may lines and complicated workflow, generaly the scripts fails with sintax error at the last line of the code but if you trace de logs , all the job is done.

If the script is fully charged in the machine's memory , wHow Could This Be Happening ?

Regards.

Shell scripts do not support dynamic changes during execution. If you ignore this restriction you will get unpredicable results. Shells tend to read their scripts as needed, but using large buffers. Also ksh compiles a script dynamically during execution but it may not do this if you are tracing.

Thanks Perderabo for clarify, I was guessing something like that.

Regards.