我可以使用GNU make的SHELL变量连接到远程shell吗? [英] Can I use GNU make's SHELL variable to connect to a remote shell?

查看:86
本文介绍了我可以使用GNU make的SHELL变量连接到远程shell吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在研究的项目之一使用gnu make进行测试.我想在没有make实现但有POSIX shell的平台上进行测试.

One of the projects I'm working on uses gnu make for testing. I would like to test on a platform that doesn't have a make implementation, but does have a POSIX shell.

是否可以创建一个脚本(最好是在python中)以缝合"要制作的远程shell,并将其放入make的SHELL环境变量中?

Is it possible to create a script (preferably in python) that can "stitch" a remote shell to make, and put it in make's SHELL environment variable?

如果没有,那么还有人能想到的另一种方式吗?

If not, is there another way anyone can think of to do it?

推荐答案

可能.

创建一个脚本,该脚本将命令转发到远程主机.例如:

Create a script that forwards commands to a remote host. For example:

#!/bin/bash
shift # remove -c argument
exec ssh remote_host "$@"

并使其可执行(chmod +x).

然后在Makefile中:

And then in Makefile:

SHELL := './my_shell.sh'
all :
    @echo `hostname` is making $@

输出:

$ make
remote_host.peer1.net is making all

这篇关于我可以使用GNU make的SHELL变量连接到远程shell吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆