PHPFixing
  • Privacy Policy
  • TOS
  • Ask Question
  • Contact Us
  • Home
  • PHP
  • Programming
  • SQL Injection
  • Web3.0

Wednesday, September 14, 2022

[FIXED] How to get Command line arguments for xterm in C?

 September 14, 2022     c, exec, unix, xterm     No comments   

Issue

My code is as follows to open a xterm terminal and run the ./paramax executable

#include <unistd.h>
#include <sys/ipc.h>

int main(int argc, char* argv[])
{
execl("/usr/bin/xterm", "/usr/bin/xterm", "-hold", "./paramax", (void*)NULL);
return 0;
}

Now the problem is for ./paramax I need to give a commandline argument for it to execute. How to proceed with this?


Solution

Run xterm -e ./paramax arg and more args, either directly or through an exec call.



Answered By - Davislor
Answer Checked By - Dawn Plyler (PHPFixing Volunteer)
  • Share This:  
  •  Facebook
  •  Twitter
  •  Stumble
  •  Digg
Newer Post Older Post Home

0 Comments:

Post a Comment

Note: Only a member of this blog may post a comment.

Total Pageviews

Featured Post

Why Learn PHP Programming

Why Learn PHP Programming A widely-used open source scripting language PHP is one of the most popular programming languages in the world. It...

Subscribe To

Posts
Atom
Posts
Comments
Atom
Comments

Copyright © PHPFixing