Why does: system("./ati-driver-installer-8.40.4-x86.x86_64.r

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?

On 8/27/07, kazaam [email protected] wrote:

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 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.

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

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.

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

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?

response = sh ./ati-driver-installer-8.40.4-x86.x86_64.run --buildpkg Ubuntu/feisty
is working correctly?

Is this a bug?

kazaam [email protected]

No, that most likely means that ati-driver-install-… is not an
executable
file.

Either set the executable flag via chmod, or just pass it as an argument
to
sh as is working for you.

Felix

it is executable and working with
system(‘sh ./ati-driver-installer-8.40.4-x86.x86_64.run --buildpkg
Ubuntu/feisty’)
system(’./ati-driver-installer-8.40.4-x86.x86_64.run --buildpkg
Ubuntu/feisty | cat-’)
but not with
system(’./ati-driver-installer-8.40.4-x86.x86_64.run --buildpkg
Ubuntu/feisty’)

and noone has any explaination for this behavior of system?

On Mon, 27 Aug 2007 23:22:51 +0900

So do…

output = system'sh ./ati-driver-installer-8.40.4-x86.x86_64.run --buildpkg Ubuntu/feisty'

arg, --less the ‘system’

I.e.

output = 'sh ./ati-driver-installer-8.40.4-x86.x86_64.run --buildpkg Ubuntu/feisty'

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs