plink user@10.220.60.xx -t '/home/user/test/testpgm'
上記の plink コマンドを使用して、Windows マシンから Linux マシンに常駐する以下のプログラムを実行できます。
#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
質問: この関数にコマンド ライン引数を渡す方法を教えてください。私は試した
plink user@10.220.60.xx -t '/home/user/test/testpgm arg1'
bash: /home/user/test/testpgm arg1: No such file or directory