[Solved] script question - theory

Issues related to applications and software problems
Post Reply
lightman47
Posts: 1522
Joined: 2014/05/21 20:16:00
Location: Central New York, USA

[Solved] script question - theory

Post by lightman47 » 2019/02/12 18:08:32

Way back in my Windows days, I found out that editing a running network based batch file 'raised the dickens' with the machine running it. Apparent was that Windows read, then executed, a line at a time.

Is the same true of linux (CentOS) scripts? Or, are they read into memory in their entirety and executed from there? I ask because I have a machine currently running a shared backup script which has 'spit out' an error to it's log file, and I want to edit the scripts to fix my screw-up before I forget about it yet again. Can I safely edit the script while a machine is running it, or must I wait till it's done?

Thank you
Last edited by lightman47 on 2019/02/12 20:13:59, edited 1 time in total.

pjsr2
Posts: 614
Joined: 2014/03/27 20:11:07

Re: script question - theory

Post by pjsr2 » 2019/02/12 18:58:53

Move the old script to a new name. As long as the process has the file open, it will continue reading that file regardless of the name change.
Then create a new copy of the file with the original name and make your edits. That file will then be used the next time.

lightman47
Posts: 1522
Joined: 2014/05/21 20:16:00
Location: Central New York, USA

Re: script question - theory

Post by lightman47 » 2019/02/12 19:29:12

Wow - thank you!

Post Reply