New to linux

Question: How to run on click?

Page 1 of 1

10 Replies - 974 Views - Last Post: 31 August 2008 - 09:02 AM

#1 polymath   User is offline

  • D.I.C Addict
  • member icon

Reputation: 54
  • View blog
  • Posts: 670
  • Joined: 04-April 08

New to linux

Post icon  Posted 21 July 2008 - 11:31 AM

Alright, so I just got some linux installed, and I went over to my IDE and programmed a console app. I then opened up the folder, and clicked on the file. It worked, but it wouldn't allow any I/O. Basically speaking, how do I make a program open up in the console? I know this is an easy question, but any help is really appreciated. In my program it has an input, opens a file after some file i/o, then holds the execution window open and exits.

To sum it up: My program skips the input, goes directly to opening the file, then exits, skipping the exit input. How can i make it so that it will run in the console and actually show the I/O (it doesn't even open a window). I know i could run it from the command line but I'd really like to do it without starting up a terminal and doing the cd... ./file... etc.

Is This A Good Question/Topic? 0
  • +

Replies To: New to linux

#2 lanec42   User is offline

  • D.I.C Head
  • member icon

Reputation: 0
  • View blog
  • Posts: 229
  • Joined: 26-March 08

Re: New to linux

Posted 21 July 2008 - 11:34 AM

What IDE are you using?
(Not that I can/will help you, but I'm a Linux n00b too. I need a good IDE.)
Was This Post Helpful? 0
  • +
  • -

#3 no2pencil   User is offline

  • Professor Snuggly Pants
  • member icon

Reputation: 6968
  • View blog
  • Posts: 31,958
  • Joined: 10-May 07

Re: New to linux

Posted 21 July 2008 - 11:35 AM

What language are you writing this in? C/C++, Perl, or is it a Shell Script?
Was This Post Helpful? 0
  • +
  • -

#4 lanec42   User is offline

  • D.I.C Head
  • member icon

Reputation: 0
  • View blog
  • Posts: 229
  • Joined: 26-March 08

Re: New to linux

Posted 21 July 2008 - 11:36 AM

Ah! That too...
Was This Post Helpful? 0
  • +
  • -

#5 polymath   User is offline

  • D.I.C Addict
  • member icon

Reputation: 54
  • View blog
  • Posts: 670
  • Joined: 04-April 08

Re: New to linux

Posted 21 July 2008 - 11:42 AM

I'm running outside the IDE, so that shouldn't matter, but anyways, i'm using the puppy linux distro 4.0 with C++ and C::B IDE 8.02

Just did a basic console application, nothing fancy. It should open up in the console, right?

Also, can i do the same with a bash shell script?

This post has been edited by polymath: 21 July 2008 - 11:50 AM

Was This Post Helpful? 0
  • +
  • -

#6 MorphiusFaydal   User is offline

  • D.I.C Lover
  • member icon

Reputation: 44
  • View blog
  • Posts: 1,376
  • Joined: 12-May 05

Re: New to linux

Posted 21 July 2008 - 05:32 PM

Run it from inside Code::Blocks. If you want to run it straight, you'll need to open a terminal, navigate to where the executable is, and run "./my_program_name" to get it to run.
Was This Post Helpful? 0
  • +
  • -

#7 polymath   User is offline

  • D.I.C Addict
  • member icon

Reputation: 54
  • View blog
  • Posts: 670
  • Joined: 04-April 08

Re: New to linux

Posted 24 July 2008 - 09:43 AM

There's no way around that? :(
Was This Post Helpful? 0
  • +
  • -

#8 MorphiusFaydal   User is offline

  • D.I.C Lover
  • member icon

Reputation: 44
  • View blog
  • Posts: 1,376
  • Joined: 12-May 05

Re: New to linux

Posted 24 July 2008 - 03:09 PM

View Postpolymath, on 24 Jul, 2008 - 11:43 AM, said:

There's no way around that? :(

Don't think so. Right click, see if there's an option called "run in terminal"... I think I remember seeing one last time I booted my laptop.
Was This Post Helpful? 0
  • +
  • -

#9 Tom9729   User is offline

  • Segmentation fault
  • member icon

Reputation: 181
  • View blog
  • Posts: 2,642
  • Joined: 30-December 07

Re: New to linux

Posted 27 July 2008 - 02:22 PM

If it's a console application, run it from the console.

Linux does not differentiate between console and graphical applications like Windows. This has to do with the difference between the executable formats (Elf vs PE).

If you click on an executable file in Linux, it will run it. It will NOT automatically pop up a console window though, because it has no way of telling apart console applications from graphical ones. :)

This post has been edited by Tom9729: 27 July 2008 - 02:22 PM

Was This Post Helpful? 0
  • +
  • -

#10 ihatepikingnames   User is offline

  • D.I.C Head
  • member icon

Reputation: 0
  • View blog
  • Posts: 119
  • Joined: 31-July 06

Re: New to linux

Posted 31 August 2008 - 08:56 AM

You can always just make a script that runs like a .bat file. just put the path and ./filename, then change the pref of the file to make sure its executable. So that when you click this all it actually does is run the one line of code, which in return runs your program.
Was This Post Helpful? 0
  • +
  • -

#11 homemade-jam   User is offline

  • Gabe's Nemesis
  • member icon

Reputation: 11
  • View blog
  • Posts: 1,300
  • Joined: 17-March 08

Re: New to linux

Posted 31 August 2008 - 09:02 AM

When I did a bit of perl, I made a bash script that automatically chmod'ed it to make it executable and then ran it, passing the arguments that I could specify in the bash...you could do something similar to speed up your testing - you could add compilation into the bash as well
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1