cancel
Showing results for 
Search instead for 
Did you mean: 

script execution

Joel Shank
Valued Contributor

script execution

I have a script that begins running at 0800, issues an 'at' to run itself at 2000, collects data for 12 hours and then uses awk to report the data collected. It works fine except when I wish to change the script. When a change is made, I rcp it to the server. When the awk runs, I get errors concerning missing '(' or missing '{'. Yet when I look at the script, I can find no errors and subsequent executions of the script run without a problem. Can anyone explain what is happening? It only seems to happen to the script that is currently running, the script that is waiting to start works fine.
5 REPLIES
Andy Monks
Honored Contributor

Re: script execution

It's because your changing the script while it's running. Try doing the rcp before it runs or after it stops.
Joel Shank
Valued Contributor

Re: script execution

I'm pretty sure it's because I am changing it while it's running. I'd like to know why. I thought that the script was read into memory and executed from there. Now I am suspecting that the system reads pieces of the script in during execution. This is not what I am used to, and need to know if that is correct.
Steven Sim Kok Leong
Honored Contributor

Re: script execution

Hi,

Did you by any chance change the shell interpreter to execute the script eg. using #!/usr/bin/csh instead of #!/usr/bin/sh or vice versa in your script or you have changed the login shell of your user account?

Why not post your script up for everyone to take a look?

Regards.

Steven Sim.
Email: steven@beepz.com. Homepage: https://www.beepz.com
CHRIS ANORUO
Honored Contributor

Re: script execution

Hi,

The line at which you receive the error, check the script line for ` or ' . It should have `.
When We Seek To Discover The Best In Others, We Somehow Bring Out The Best In Ourselves.
Fred Martin_1
Valued Contributor

Re: script execution

You mentioned that it runs for 12 hours. By chance, are you installing the new version while it is running? Perhaps that is tripping it up. That would explain why it subsequently runs OK.
fmartin@applicatorssales.com