system commands

Discussion in 'Ruby' started by Jeffrey Bowen, Jul 16, 2007.

  1. 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/games/front
     
    Jeffrey Bowen, Jul 16, 2007
    #1
    1. Advertising

  2. using system() or backticks ``

    cmd = `uptime`
    puts cmd

    On 7/16/07, Jeffrey Bowen <> 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/games/front
    >
    >



    --
    Michael Steinfeld
    Linux Admin/Developer
    AIM: mikesteinfeld
    GTALK:
     
    Michael Steinfeld, Jul 16, 2007
    #2
    1. Advertising

  3. On 7/16/07, Jeffrey Bowen <> 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/index.shtml
     
    Gregory Brown, Jul 16, 2007
    #3
  4. Jeffrey Bowen

    Aryk Grosz Guest

    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 <> 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/index.shtml


    --
    Posted via http://www.ruby-forum.com/.
     
    Aryk Grosz, Dec 1, 2007
    #4
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. caleb
    Replies:
    0
    Views:
    2,885
    caleb
    Jan 3, 2006
  2. Ben Pfaff

    Re: man pages for C commands (GCC commands)

    Ben Pfaff, Jun 24, 2003, in forum: C Programming
    Replies:
    4
    Views:
    3,975
    Thomas Stegen
    Jun 28, 2003
  3. jon c
    Replies:
    0
    Views:
    418
    jon c
    Feb 11, 2004
  4. Tim Stanka
    Replies:
    1
    Views:
    805
    Jeff Epler
    Aug 2, 2004
  5. twsnnva
    Replies:
    6
    Views:
    951
    Cliff Wells
    Sep 11, 2004
Loading...

Share This Page