[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

comp.lang.ruby

Call an application from Ruby

Luiz Macchi

8/22/2007 11:31:00 AM

Hi all, how to call an application from Ruby inside on Linux ?

I´d like to run 'KCalc' for example

thank any help
--
Posted via http://www.ruby-....

2 Answers

Daniel Lucraft

8/22/2007 11:38:00 AM

0

Luiz Macchi wrote:
> Hi all, how to call an application from Ruby inside on Linux ?
>
> I´d like to run 'KCalc' for example
>
> thank any help

You can execute a system command by putting it between `backticks`. On
Gnome, the calculator command is gcalctool and this works for me:

dan: /home/dan$ irb
irb(main):001:0> `gcalctool`
=> ""

best,
Dan
--
Posted via http://www.ruby-....

byte8bits

8/22/2007 2:11:00 PM

0

Daniel Lucraft wrote:
> Luiz Macchi wrote:
>> Hi all, how to call an application from Ruby inside on Linux ?
>>
>> I´d like to run 'KCalc' for example
>>
>> thank any help
>
> You can execute a system command by putting it between `backticks`. On
> Gnome, the calculator command is gcalctool and this works for me:
>
> dan: /home/dan$ irb
> irb(main):001:0> `gcalctool`
> => ""

You might also do this:

system('gcalctool')