Why does:system("./ati-driver-installer-8.40.4-x86.x86_64.run --buildpkg Ubuntu/feisty")not work ? I

Discussion in 'Ruby' started by kazaam, Aug 26, 2007.

  1. kazaam

    kazaam Guest

    Well,
    while I thought I could finish my script for installing an ati-driver today I wanted to test it now but I have this problem mentioned in the subject. My ruby-script ist started with sudo ./ati.rb so it has the necassary right for everything but this command:
    system("./ati-driver-installer-8.40.4-x86.x86_64.run --buildpkg Ubuntu/feisty")
    always does nothing but failing and
    puts'errormessage' if not system("./ati-driver-installer-8.40.4-x86.x86_64.run --buildpkg Ubuntu/feisty")
    alway shows errormessage but the command itself prints no error. Nothing. It happens simply nothing. Exact the same command typed in, in the shell works perfectly but this here always fails. Can anybody tell me way?
    --
    kazaam <>
    kazaam, Aug 26, 2007
    #1
    1. Advertising

  2. kazaam

    botp Guest

    Re: Why does: system("./ati-driver-installer-8.40.4-x86.x86_64.run --buildpkg Ubuntu/feisty") not work ? It always fails without any error?

    On 8/27/07, kazaam <> wrote:
    > Well, while I thought I could finish my script for installing an ati-driver today
    >I wanted to test it now but I have this problem mentioned in the subject. My
    >ruby-script ist started with sudo ./ati.rb so it has the necassary right for
    >everything but this command:
    > system("./ati-driver-installer-8.40.4-x86.x86_64.run --buildpkg Ubuntu/feisty")
    > always does nothing but failing and
    > puts'errormessage' if not system("./ati-driver-installer-8.40.4-x86.x86_64.run
    > --buildpkg Ubuntu/feisty") alway shows errormessage but the command itself
    > prints no error. Nothing. It happens simply nothing. Exact the same command
    > typed in, in the shell works perfectly but this here always fails.
    > Can anybody tell me way?


    i cannot tell you why, but i can tell a way to make it run.
    try,

    system("sh ./ati-driver-installer-8.40.4-x86.x86_64.run --buildpkg
    Ubuntu/feisty")

    note we ran the shell sh

    or

    system("./ati-driver-installer-8.40.4-x86.x86_64.run --buildpkg
    Ubuntu/feisty | cat -")

    yes, that's even weirder, piping to cat standard input

    hth somehow.
    kind regards -botp
    botp, Aug 26, 2007
    #2
    1. Advertising

  3. kazaam

    Phlip Guest

    Re: Why does: system("./ati-driver-installer-8.40.4-x86.x86_64.run --buildpkg Ubuntu/feisty") not work ? It always fails without any error?

    kazaam wrote:

    > system("./ati-driver-installer-8.40.4-x86.x86_64.run --buildpkg
    > Ubuntu/feisty")
    > always does nothing but failing


    Some commands don't tell their environment when they fail. If you have a
    verbose mode, try this:

    response = `run ... --verbose ...`

    Now use Rexexp to interpret the response and detect success or failure.

    --
    Phlip
    http://www.oreilly.com/catalog/9780596510657/
    "Test Driven Ajax (on Rails)"
    assert_xpath, assert_javascript, & assert_ajax
    Phlip, Aug 26, 2007
    #3
  4. kazaam

    kazaam Guest

    hi thanks both methods are working great but really confusing, that it doesn't work the normal way:)

    On Mon, 27 Aug 2007 02:21:45 +0900
    botp <> wrote:

    > On 8/27/07, kazaam <> wrote:
    > > Well, while I thought I could finish my script for installing an ati-driver today
    > >I wanted to test it now but I have this problem mentioned in the subject. My
    > >ruby-script ist started with sudo ./ati.rb so it has the necassary right for
    > >everything but this command:
    > > system("./ati-driver-installer-8.40.4-x86.x86_64.run --buildpkg Ubuntu/feisty")
    > > always does nothing but failing and
    > > puts'errormessage' if not system("./ati-driver-installer-8.40.4-x86.x86_64.run
    > > --buildpkg Ubuntu/feisty") alway shows errormessage but the command itself
    > > prints no error. Nothing. It happens simply nothing. Exact the same command
    > > typed in, in the shell works perfectly but this here always fails.
    > > Can anybody tell me way?

    >
    > i cannot tell you why, but i can tell a way to make it run.
    > try,
    >
    > system("sh ./ati-driver-installer-8.40.4-x86.x86_64.run --buildpkg
    > Ubuntu/feisty")
    >
    > note we ran the shell sh
    >
    > or
    >
    > system("./ati-driver-installer-8.40.4-x86.x86_64.run --buildpkg
    > Ubuntu/feisty | cat -")
    >
    > yes, that's even weirder, piping to cat standard input
    >
    > hth somehow.
    > kind regards -botp
    >



    --
    kazaam <>
    kazaam, Aug 26, 2007
    #4
  5. kazaam

    kazaam Guest

    Hi Phlip,
    I don't know exactly what you mean. Normally --buildpkg is verbos-mode like, so when it fails it's normally printed on the screen. With the two methods mentioned above I also have output for progress and success/error on the screen. system() is not supressing any errors. They are normaly printed on the screen, so system() always makes verbose messages or do you mean something else?

    greets

    On Mon, 27 Aug 2007 02:34:18 +0900
    "Phlip" <> wrote:

    > kazaam wrote:
    >
    > > system("./ati-driver-installer-8.40.4-x86.x86_64.run --buildpkg
    > > Ubuntu/feisty")
    > > always does nothing but failing

    >
    > Some commands don't tell their environment when they fail. If you have a
    > verbose mode, try this:
    >
    > response = `run ... --verbose ...`
    >
    > Now use Rexexp to interpret the response and detect success or failure.
    >
    > --
    > Phlip
    > http://www.oreilly.com/catalog/9780596510657/
    > "Test Driven Ajax (on Rails)"
    > assert_xpath, assert_javascript, & assert_ajax
    >
    >



    --
    kazaam <>
    kazaam, Aug 26, 2007
    #5
  6. kazaam

    Phlip Guest

    Re: Why does: system("./ati-driver-installer-8.40.4-x86.x86_64.run --buildpkg Ubuntu/feisty") not work ? It always fails without any error?

    kazaam wrote:

    > I don't know exactly what you mean. Normally --buildpkg is verbos-mode
    > like, so when it fails it's normally printed on the screen. With the two
    > methods mentioned above I also have output for progress and success/error
    > on the screen. system() is not supressing any errors. They are normaly
    > printed on the screen, so system() always makes verbose messages or do you
    > mean something else?


    system('') will print the output "on the screen", meaning to the console.

    >> response = `run ... --verbose-or-whatever ...`


    Backticks, ``, will return the output to your program as a string.

    >> Now use Rexexp to interpret the response and detect success or failure.


    --
    Phlip
    http://www.oreilly.com/catalog/9780596510657/
    "Test Driven Ajax (on Rails)"
    assert_xpath, assert_javascript, & assert_ajax
    Phlip, Aug 26, 2007
    #6
  7. kazaam

    kazaam Guest

    Okay I did as suggested:

    #!/usr/bin/env ruby
    $Verbose=true
    response = `./ati-driver-installer-8.40.4-x86.x86_64.run --buildpkg Ubuntu/feisty`
    puts response

    outputs:
    ./test.rb:6: command not found: ./ati-driver-installer-8.40.4-x86.x86_64.run --buildpkg Ubuntu/feisty
    but the same with
    response = `sh ./ati-driver-installer-8.40.4-x86.x86_64.run --buildpkg Ubuntu/feisty`
    is working correctly?

    Is this a bug?
    --
    kazaam <>
    kazaam, Aug 27, 2007
    #7
    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. jblazi
    Replies:
    5
    Views:
    421
    jblazi
    Aug 16, 2004
  2. Horace Nunley

    why why why does function not work

    Horace Nunley, Sep 27, 2006, in forum: ASP .Net
    Replies:
    1
    Views:
    450
    =?Utf-8?B?UGV0ZXIgQnJvbWJlcmcgW0MjIE1WUF0=?=
    Sep 27, 2006
  3. Mr. SweatyFinger

    why why why why why

    Mr. SweatyFinger, Nov 28, 2006, in forum: ASP .Net
    Replies:
    4
    Views:
    863
    Mark Rae
    Dec 21, 2006
  4. Mr. SweatyFinger
    Replies:
    2
    Views:
    1,763
    Smokey Grindel
    Dec 2, 2006
  5. Homer
    Replies:
    9
    Views:
    416
    Mark Rae [MVP]
    Sep 6, 2007
Loading...

Share This Page