Bash-远程库

问题描述:

我们是两个在Bash工具箱上工作的学生,我们遇到了一个问题:

We're two student working on a Bash Tools Box, and we come across a problem :

我们的本地脚本使用功能,这些功能存储在两个本地库中.

Our local script use functions, stocked in two local libraries.

我们的脚本使用第一个库中的函数,而最后一个使用第二个库中的函数.

Our script uses functions inside the first library, and this last uses functions inside the second one library.

脚本<-库1<-库2

Script <-- Library1 <-- Library2

我们不能将两个库融合在一起.

We can't fusion the two libraries in one.

我们实际上使用此命令在远程计算机上运行脚本:

We actually use this command to run our script on a remote computer :

ssh login@remoteIP bash < ~/script.sh

问题是:如何在脚本中设置库位置

The question is : How to set in the script the library location

使用 bashpp .

#include 替换.调用,然后通过 bashpp 运行它:

Replace your . calls with #include and then run it through bashpp:

bashpp ~/script.sh | ssh login@remoteIP bash -s