我目前正在制作一个程序,其中包括以下调用,以便将所有软件包更新到最新版本:
yum -y update
我正在处理的程序是用bash脚本编写的,因为我在updater.sh脚本中使用了以下第一行:
#!/bin/bash
我正在研究各种场景,我已经介绍了更新更新程序脚本。我想知道如果在yum -y update
调用期间将bash更新为更新版本会发生什么。
我的updater.sh脚本:
答案 0 :(得分:1)
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.