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

K

kazaam

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?
 
B

botp

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
 
P

Phlip

kazaam said:
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.
 
K

kazaam

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

kazaam

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
 
P

Phlip

kazaam said:
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.

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

kazaam

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?
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,755
Messages
2,569,537
Members
45,023
Latest member
websitedesig25

Latest Threads

Top