|
From: | Martin |
Subject: | setting SHELL to ssh script for load sharing parallel make |
Date: | Fri, 29 Aug 2008 08:42:43 -0400 (EDT) |
User-agent: | Alpine 1.10 (LNX 962 2008-03-14) |
Hi,I thought of setting SHELL to some ssh script to allow load sharing of parallel make (when you use -j). But I have techical difficulties: line continuations do not work well. This simplest form I have:
$ cat myshell #!/bin/bash # Turn $* into an array to remove -c args=( `echo $*` ) ssh localhost "cd $PWD; ${args[*]:1}" $ cat Makefile SHELL = ./myshell all: # Comment are okay t=`echo "\"Complicated quoting seems okay\'\\""` echo This is the remote host as desired: $$HOSTNAME echo But line continuations && \ echo are not.I suspect it has to do with the shell and not with make, although make does pass the line continuation character "\" without passing the newline to ./myshell (echo $* to see).
Any advice would be appreciated as I have tried many different variations for quoting the ssh arguments (such as address@hidden). The idea is to make it work the same with and without overriding SHELL.
Note that $PWD must be expanded on the localhost, and the args aims to be the thing make passes to the shell which I want to relay to the remote host.
Has this been attempted before? How can I fix the line continuation problem?
Thanks, Martin
[Prev in Thread] | Current Thread | [Next in Thread] |