Reputation: 5856
I'm trying to do redirect the stdin to the ssh on a server, but the script contains parameters.
I'm doing this inside a Makefile
./docker-machine ssh machine < scripts/provision-docker-images.sh "param1" "param2"
I tried many options like
< $(scripts/provision-docker-images.sh "param1" "param2")
<(scripts/provision-docker-images.sh "param1" "param2")
any idea?
Upvotes: 0
Views: 930
Reputation: 180181
The mechanism for connecting the standard output of one command to the standard input of another command is the pipe. The shell's operator for that is |
. If I understand correctly that
docker-machine ssh
will forward its own standard input over the ssh connection to the remote shellthen what you want would be
scripts/provision-docker-images.sh "param1" "param2" \
| ./docker-machine ssh machine
(line splitting optional).
In contrast,
<
is for redirecting a command's standard input to come from a file;$(...)
is for expanding the output of a command to form part of another command (similar to parameter expansion);<(...)
is for creating a file name from which the output of a command can be read (i.e. designating the read end of a FIFO).Upvotes: 1