小编RET*_*NCE的帖子

Shell脚本中的“源”命令不起作用

我有一个要在Centos 7中获取的文件。如果这样做,它可以正常工作:

$ source set_puregev_env
Run Code Online (Sandbox Code Playgroud)

但是,如果我将其放在shell脚本中,它将无法正常工作。

$ sh xRUN 
xRUN: line 3: source: set_puregev_env: file not found
Run Code Online (Sandbox Code Playgroud)

这是我的shell脚本:xRUN

#!/bin/bash

source set_puregev_env
Run Code Online (Sandbox Code Playgroud)

谁能告诉我我可能做错了什么,或者想念吗?

bash shell sh command-line-interface

3
推荐指数
1
解决办法
1万
查看次数

标签 统计

bash ×1

command-line-interface ×1

sh ×1

shell ×1