请参阅我想在我的shell脚本中使用source
命令。现在,当我在终端输入源这表明像从shell脚本中的另一个文件读取命令?
-bash: source: filename argument required
source: usage: source filename [arguments]
现在,当我使用这在我的shell脚本这样
#!/bin/sh
source
,并保存为test.sh
并运行,然后得到像这
./test.sh: 2: source: not found
如何解决这个问题?
来源需要参数。你期望它没有一个做什么? – knittl 2012-08-03 13:34:20
我知道它,但这里的问题是源命令没有找到...如果我给论点仍然不会工作.. – 2012-08-03 13:35:23
在bash或csh中的'源文件'是一个命令,从'file'到当前shell (脚本或交互式会话)。这个更便携的版本是* dot *命令'。 file'。这在所有常见的unix shell上都受支持。 – 2012-08-03 13:38:09