Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6607519
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T19:30:43+00:00 2026-05-25T19:30:43+00:00

I have found that i can use something called a launcher in linux by

  • 0

I have found that i can use something called a launcher in linux by right clicking the desktop.

i have set this to run my program in the terminal which i am happy about but i want to give it some default values when it runs.

Im guessing i should put the values after the program path with – befor them but im not sure about what im doing.

can some point me to a document or something that lists the ways to include values and what i can include in the path.

also if i do this how will my program read them ? will they be passed to main ?

Is it possible to set it up in a way that the program does not know how many variables are coming at start up but will read as many as it gets.

im using c++.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-25T19:30:44+00:00Added an answer on May 25, 2026 at 7:30 pm

    If I recall correctly running a terminal is something like

    rxvt -backspacekey  -sl 2500 -tn msys -geometry 80x25 -e 'script.sh -param' --login -i
    

    -e command arg … command to execute

    So create a file named myApp.sh (pretty much an equivalent of a .bat on windows)

    enter the following:

    !/bin/sh
    rxvt -geometry 80x25 -e 'yourExecutableName yourCommandLine' --login -i
    

    After saving, just chmod +x on the file (so Linux will consider it as an executable)

    chmod +x myApp.sh
    

    After this, you can run it from anywhere on your machine (if the dir is in the PATH enviroment variable) or via double click in Gnome File Manager.

    If you need to pass args also to the shell, you can access every single param with
    $0, $1, $2 (equivalents to %1, %2 in MS batch).

    For command lines, a C/C++ program starts usually with a function main

    int main (int argc, char ** argv) {
      exit(0);
    }
    

    argc is the number of arguments received in input, while argv is a pointer to an array of char * (the actual commandline), you may parse ’em directly.

    PS: note that I use rxvt, you probably want to change this to xterm o gterm or whatever terminal you prefer to use.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am learning Java and just found that the Interface can have fields, which
I have a program i frequently use that is made with .NET. This program
Lets say that in this case i have 4 divs called .CountThese and i
Besides INSERT/UPDATE/SELECT/DELETE MySQL has something called HANDLER . I've read that it can be
I have a function that takes another function as a parameter. Something like this
I have found that my HTML is, to be honest, very clunky. Small, simple
I have found that there is generally a singe type or namespace that takes
I have found that how to determine what columns are primary key column of
I have found that I often have to implement some sort of a scheduler
I have found that creating a zip file using the Zip task provided by

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.