linux下用c语言打开终端并传参
要做的是在程序中开一个终端,并执行写好的另一个程序。execlp("gnome-terminal","gnome-terminal","-x","/home/bear/D...
要做的是 在程序中开一个终端,并执行写好的另一个程序。
execlp("gnome-terminal","gnome-terminal","-x","/home/bear/Desktop/rubbish/s", NULL); 运行时提示
Failed to connect to the session manager: None of the authentication protocols specified are supported。
然后改用system("sudo gnome-terminal /home/bear/Desktop/rubbish/s");
可以打开终端,但是不能执行,怎样才能向新的终端传参? 展开
execlp("gnome-terminal","gnome-terminal","-x","/home/bear/Desktop/rubbish/s", NULL); 运行时提示
Failed to connect to the session manager: None of the authentication protocols specified are supported。
然后改用system("sudo gnome-terminal /home/bear/Desktop/rubbish/s");
可以打开终端,但是不能执行,怎样才能向新的终端传参? 展开
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询