plink [email protected] -t '/home/user/test/testpgm'
I'm able to run the below program which resides on a Linux machine from a windows machine using the above plink cmd.
#include<stdio.h>
int main(int argc,char *argv[])
{
int i;
char buf[30];
printf("Test Pgm \n");
printf("No of Arguments=%d\n",argc);
printf("Enter a string:");
fflush(stdout);
gets(buf);
printf("Input str:%s \n",buf);
return 0;
}
gcc test.c -o testpgm
Question: How to pass command line arguments to this function? I tried
plink [email protected] -t '/home/user/test/testpgm arg1'
bash: /home/user/test/testpgm arg1: No such file or directory
The shell treats strings inside quotes as a single word, which means that plink tries to execute the program /home/user/test/testpgm arg1. Obviously this won't work.
What you have to do is very simple: Skip the quotes!
$ plink [email protected] -t /home/user/test/testpgm arg1
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With