Results 1 to 3 of 3
So I hope the name says it all
I have a local xml file that's an argument to a service that i'll be running on a remote box
the general ...
- 01-26-2010 #1Just Joined!
- Join Date
- May 2006
- Location
- PA
- Posts
- 13
execute remote command with ssh with local file as parameter
So I hope the name says it all
I have a local xml file that's an argument to a service that i'll be running on a remote box
the general idea was something like ssh user(at)remotebox "service localxml"
this doesn't seem to work when i use a test of
ssh user(at)remotebox "cat locallist"
"cat: locallist: No such file or directory"
any thoughts?
- 01-26-2010 #2
I got it to work using:
The exe was a simple C program:Code:ssh user@192.168.0.144 /home/user/somedir/someexe < datafile
someexe.c
Code:#include <stdio.h> #include <stdlib.h> int main(int argc, char**argv) { unsigned int ch= 0; while ((ch = fgetc(stdin)) != EOF) { fputc(ch, stdout); } exit(EXIT_SUCCESS); }Make mine Arch Linux
- 02-10-2010 #3Just Joined!
- Join Date
- May 2006
- Location
- PA
- Posts
- 13
looks good thanks gerard4143. That looks simpler than my solution
I did something like
but i think yours is the same but prettier and easier to understandCode:cat "xml" | ssh user@host exe_to_execute
thanks


Reply With Quote