[lnkForumImage]
TotalShareware - Download Free Software

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


 

Forums >

comp.lang.ruby

system commands

jabowen

7/16/2007 9:17:00 PM

Let me first apologize I asked this question last week
and lost the answer. How do I run Linux commands in
side a ruby program? I'll print it out this time.

Thanks
Jeff



____________________________________________________________________________________
Bored stiff? Loosen up...
Download and play hundreds of games for free on Yahoo! Games.
http://games.yahoo.com/g...

5 Answers

Michael Steinfeld

7/16/2007 9:35:00 PM

0

using system() or backticks ``

cmd = `uptime`
puts cmd

On 7/16/07, Jeffrey Bowen <ja_bowen@yahoo.com> wrote:
> Let me first apologize I asked this question last week
> and lost the answer. How do I run Linux commands in
> side a ruby program? I'll print it out this time.
>
> Thanks
> Jeff
>
>
>
> ____________________________________________________________________________________
> Bored stiff? Loosen up...
> Download and play hundreds of games for free on Yahoo! Games.
> http://games.yahoo.com/g...
>
>


--
Michael Steinfeld
Linux Admin/Developer
AIM: mikesteinfeld
GTALK: mikeisgreat@gmail.com

Gregory Brown

7/16/2007 9:50:00 PM

0

On 7/16/07, Jeffrey Bowen <ja_bowen@yahoo.com> wrote:
> Let me first apologize I asked this question last week
> and lost the answer. How do I run Linux commands in
> side a ruby program? I'll print it out this time.

Michael answered your question, but to help you find old posts next time around:
http://blade.nagaokaut.ac.jp/ruby/ruby-talk/i...

Aryk Grosz

12/1/2007 11:41:00 PM

0

I have a line like this:

response = `<some command>`

Why might it be that response is only NIL when that command is run
through a rake task initiated by cron? If i just run the rake task
normally it works fine.


Gregory Brown wrote:
> On 7/16/07, Jeffrey Bowen <ja_bowen@yahoo.com> wrote:
>> Let me first apologize I asked this question last week
>> and lost the answer. How do I run Linux commands in
>> side a ruby program? I'll print it out this time.
>
> Michael answered your question, but to help you find old posts next time
> around:
> http://blade.nagaokaut.ac.jp/ruby/ruby-talk/i...

--
Posted via http://www.ruby-....

The Peeler

9/15/2010 11:21:00 AM

0

On Wed, 15 Sep 2010 18:22:17 +0800, Delirious The Retard, the resident
psychopath of sci and scj, IMPERSONATING his master, The Peeler, wrote:

> On 15 Sep 2010 02:13:14 GMT, The Chief Instigator <patrick@io.com>
> wrote:
>
>>On Tue, 14 Sep 2010 16:52:24 +0800, The Peeler <peelingthe@invalid.admin> wrote:
>>> On 14 Sep 2010 02:13:36 GMT, The Chief Instigator <patrick@io.com>
>>> wrote:
>>>
>>>>On Mon, 13 Sep 2010 16:16:09 +0800, The Peeler <peelingthe@invalid.admin> wrote:
>>>>> On 13 Sep 2010 01:30:05 GMT, The Chief Instigator <patrick@io.com>
>>>>> wrote:
>>>>>
>>>>>>On Mon, 13 Sep 2010 08:42:58 +0800, The Peeler <peelingthe@invalid.admin> wrote:
>>>>>>> On 12 Sep 2010 16:09:30 GMT, The Chief Instigator <patrick@io.com>
>>>>>>> wrote:
>>>>>>>
>>>>>>>>On Sun, 12 Sep 2010 19:43:19 +0800, The Peeler <peelingthe@invalid.admin> wrote:
>>>>>>>>> On 12 Sep 2010 00:17:16 GMT, The Chief Instigator <patrick@io.com>
>>>>>>>>> wrote:
>>>>>>>>>
>>>>>>>>>>On Sun, 12 Sep 2010 06:59:02 +0800, The Peeler <peelingthe@invalid.admin> wrote:
>>>>>>>>>>> On 11 Sep 2010 22:51:19 GMT, The Chief Instigator <patrick@io.com>
>>>>>>>>>>> wrote:
>>>>>>>>>>>
>>>>>>>>>>>>On Sun, 12 Sep 2010 04:27:15 +0800, The Peeler <peelingthe@invalid.admin> wrote:
>>>>>>>>>>>>> On 11 Sep 2010 20:22:16 GMT, The Chief Instigator <patrick@io.com>
>>>>>>>>>>>>> wrote:
>>>>>>>>>>>>>
>>>>>>>>>>>>>>On Sat, 11 Sep 2010 13:01:20 +0200, The Peeler <peelingthe@invalid.admin> wrote:
>>>>>>>>>>>>>>> On Sat, 11 Sep 2010 18:35:06 +0800, Poor The Retard, our resident
>>>>>>>>>>>>>>> psychopath, IMPERSONATING his master, Patrick L. Humphrey, wrote:
>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>>> No, you are. My real name's Patrick L. Humphrey. What's yours,
>>>>>>>>>>>>>>>>>> asshole?
>>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>>Too bad yours is mine. (As in, my middle name, and a few hundred other
>>>>>>>>>>>>>>>>>details.)
>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>> You're impersonating me, you anonymous chickenshit asshole.
>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>> You poor delirious devastated psycho! Don't you have any health insurance so
>>>>>>>>>>>>>>> that you could afford a psychiatrist? You desperately NEED one, our
>>>>>>>>>>>>>>> battered punching bag! LOL
>>>>>>>>>>>>>>
>>>>>>>>>>>>>>I'd support tying him up in the Bell Street-end goal for the first home game
>>>>>>>>>>>>>>(for the Aeros' first home practice of the 2010-11 season) on October
>>>>>>>>>>>>>>16...without padding or a goalie mask.
>>>>>>>>>>>>>
>>>>>>>>>>>>> Who gives a shit about your basketball fantasies, Mein Humpf?
>>>>>>>>>>>>
>>>>>>>>>>>>Keep being the idiot you are, as you'd rather kill yourself than answer to a
>>>>>>>>>>>>legitimate identity.
>>>>>>>>>>>
>>>>>>>>>>> When are *you* going to use your real name instead of this ridiculous
>>>>>>>>>>> "Patrick Humphrey" pseudonym, you anonymous asshole?
>>>>>>>>>>
>>>>>>>>>>I've only used it for 55 and a third years, Punked Peeler.
>>>>>>>>>
>>>>>>>>> Well, you're not using your real name here, asshole.
>>>>>>>>
>>>>>>>>You're too stupid to admit your idiocy, kid...frustration is all that's left
>>>>>>>>for you.
>>>>>>>
>>>>>>> You're too stupid to realise you're not a Tejan, son...and that you
>>>>>>> never will be.
>>>>>>
>>>>>>I'll leave that quote on your headstone. Too bad you'll never be among the
>>>>>>27 million.
>>>>>
>>>>> Nor will you, shithead. You'll always be just one more Kenfucky
>>>>> carpetbagger.
>>>>
>>>>Too bad I'm a registered Texas voter for 37 years.
>>>
>>> Too bad that doesn't make you a Tejan. It never will.
>>>
>>>>Sucks to be you.
>>>
>>> *Really* sucks to be *you*.
>>
>>Thanks for your confirmation that you'll *never* know. Remind me when you
>>become the first 35-year-old to finally complete kindergarten. I went
>>through nine months of it in 1960 and 1961. (Not 1990 and '91, obviously.)
>
> You flunked kindergarten. Twice.

<BG> LAME, you miserable psycho! BTW, you know already where and how you'll
spend the coming weekend, poor psycho? No? Well, WE know already! LMAO!

--
Retarded, subnormal and extremely proud of it: our resident psychopath, The
Retard!

The Chief Instigator

9/17/2010 5:55:00 AM

0

On Wed, 15 Sep 2010 18:22:17 +0800, The Peeler <peelingthe@invalid.admin> wrote:
> On 15 Sep 2010 02:13:14 GMT, The Chief Instigator <patrick@io.com>
> wrote:
>
>>On Tue, 14 Sep 2010 16:52:24 +0800, The Peeler <peelingthe@invalid.admin> wrote:
>>> On 14 Sep 2010 02:13:36 GMT, The Chief Instigator <patrick@io.com>
>>> wrote:
>>>
>>>>On Mon, 13 Sep 2010 16:16:09 +0800, The Peeler <peelingthe@invalid.admin> wrote:
>>>>> On 13 Sep 2010 01:30:05 GMT, The Chief Instigator <patrick@io.com>
>>>>> wrote:
>>>>>
>>>>>>On Mon, 13 Sep 2010 08:42:58 +0800, The Peeler <peelingthe@invalid.admin> wrote:
>>>>>>> On 12 Sep 2010 16:09:30 GMT, The Chief Instigator <patrick@io.com>
>>>>>>> wrote:
>>>>>>>
>>>>>>>>On Sun, 12 Sep 2010 19:43:19 +0800, The Peeler <peelingthe@invalid.admin> wrote:
>>>>>>>>> On 12 Sep 2010 00:17:16 GMT, The Chief Instigator <patrick@io.com>
>>>>>>>>> wrote:
>>>>>>>>>
>>>>>>>>>>On Sun, 12 Sep 2010 06:59:02 +0800, The Peeler <peelingthe@invalid.admin> wrote:
>>>>>>>>>>> On 11 Sep 2010 22:51:19 GMT, The Chief Instigator <patrick@io.com>
>>>>>>>>>>> wrote:
>>>>>>>>>>>
>>>>>>>>>>>>On Sun, 12 Sep 2010 04:27:15 +0800, The Peeler <peelingthe@invalid.admin> wrote:
>>>>>>>>>>>>> On 11 Sep 2010 20:22:16 GMT, The Chief Instigator <patrick@io.com>
>>>>>>>>>>>>> wrote:
>>>>>>>>>>>>>
>>>>>>>>>>>>>>On Sat, 11 Sep 2010 13:01:20 +0200, The Peeler <peelingthe@invalid.admin> wrote:
>>>>>>>>>>>>>>> On Sat, 11 Sep 2010 18:35:06 +0800, Poor The Retard, our resident
>>>>>>>>>>>>>>> psychopath, IMPERSONATING his master, Patrick L. Humphrey, wrote:
>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>>> No, you are. My real name's Patrick L. Humphrey. What's yours,
>>>>>>>>>>>>>>>>>> asshole?
>>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>>Too bad yours is mine. (As in, my middle name, and a few hundred other
>>>>>>>>>>>>>>>>>details.)
>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>> You're impersonating me, you anonymous chickenshit asshole.
>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>> You poor delirious devastated psycho! Don't you have any health insurance so
>>>>>>>>>>>>>>> that you could afford a psychiatrist? You desperately NEED one, our
>>>>>>>>>>>>>>> battered punching bag! LOL
>>>>>>>>>>>>>>
>>>>>>>>>>>>>>I'd support tying him up in the Bell Street-end goal for the first home game
>>>>>>>>>>>>>>(for the Aeros' first home practice of the 2010-11 season) on October
>>>>>>>>>>>>>>16...without padding or a goalie mask.
>>>>>>>>>>>>>
>>>>>>>>>>>>> Who gives a shit about your basketball fantasies, Mein Humpf?
>>>>>>>>>>>>
>>>>>>>>>>>>Keep being the idiot you are, as you'd rather kill yourself than answer to a
>>>>>>>>>>>>legitimate identity.
>>>>>>>>>>>
>>>>>>>>>>> When are *you* going to use your real name instead of this ridiculous
>>>>>>>>>>> "Patrick Humphrey" pseudonym, you anonymous asshole?
>>>>>>>>>>
>>>>>>>>>>I've only used it for 55 and a third years, Punked Peeler.
>>>>>>>>>
>>>>>>>>> Well, you're not using your real name here, asshole.
>>>>>>>>
>>>>>>>>You're too stupid to admit your idiocy, kid...frustration is all that's left
>>>>>>>>for you.
>>>>>>>
>>>>>>> You're too stupid to realise you're not a Tejan, son...and that you
>>>>>>> never will be.
>>>>>>
>>>>>>I'll leave that quote on your headstone. Too bad you'll never be among the
>>>>>>27 million.
>>>>>
>>>>> Nor will you, shithead. You'll always be just one more Kenfucky
>>>>> carpetbagger.
>>>>
>>>>Too bad I'm a registered Texas voter for 37 years.
>>>
>>> Too bad that doesn't make you a Tejan. It never will.
>>>
>>>>Sucks to be you.
>>>
>>> *Really* sucks to be *you*.
>>
>>Thanks for your confirmation that you'll *never* know. Remind me when you
>>become the first 35-year-old to finally complete kindergarten. I went
>>through nine months of it in 1960 and 1961. (Not 1990 and '91, obviously.)
>
> You flunked kindergarten. Twice.

Is *that* why I graduated high school a week and a half after I turned 17?
(I made up for that by spending five years to get my BA. Tell me what my
major was, durak.)

--
Patrick L. "The Chief Instigator" Humphrey (patrick@prismnet.com) Houston, TX
www.prismnet.com/~patrick (TCI's 2009-10 Houston Aeros) AA#2273
LAST GAME: San Antonio 3, Houston 2 (April 11)
NEXT GAME: Saturday, October 9 at Oklahoma City, 7:05