Issue
I am currently working on a procedure which includes the following call in order to update all packages to the latest version:
yum -y update
The procedure I am working on is written in a bash script as I am using the following first line in my updater.sh script:
#!/bin/bash
I am working out all kinds of scenarios and I have already covered updating the updater script. I am wondering what will happen if bash is updated to a newer version during the yum -y update
call.
Will my updater.sh script:
- Continue executing
- Be stopped
- .. something else?
Solution
Short answer: It will continue to execute.
When you start a script, a new process is started for the program specified to interpret the script (in this case, Bash). The operating system reads code from the program file on disk and loads it into memory where it stays for as long as the script is being executed. If Bash is updated on your system, the program code stored on the filesystem is effected – not the program code currently resident in memory.
Answered By - Anthony Geoghegan Answer Checked By - Mildred Charles (WPSolving Admin)