bash从脚本更新

时间:2016-08-31 11:50:37

标签: bash yum

我目前正在制作一个程序,其中包括以下调用,以便将所有软件包更新到最新版本:

yum -y update

我正在处理的程序是用bash脚本编写的,因为我在updater.sh脚本中使用了以下第一行:

#!/bin/bash

我正在研究各种场景,我已经介绍了更新更新程序脚本。我想知道如果在yum -y update调用期间将bash更新为更新版本会发生什么。

我的updater.sh脚本:

  1. 继续执行
  2. 停止
  3. ..别的什么?

1 个答案:

答案 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.