Velocity Reviews - Computer Hardware Reviews

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

Reply
Thread Tools

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
Guest
Posts: n/a
 
      08-26-2007
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 <(E-Mail Removed)>
 
Reply With Quote
 
 
 
 
botp
Guest
Posts: n/a
 
      08-26-2007
On 8/27/07, kazaam <(E-Mail Removed)> 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

 
Reply With Quote
 
 
 
 
Phlip
Guest
Posts: n/a
 
      08-26-2007
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


 
Reply With Quote
 
kazaam
Guest
Posts: n/a
 
      08-26-2007
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 <(E-Mail Removed)> wrote:

> On 8/27/07, kazaam <(E-Mail Removed)> 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 <(E-Mail Removed)>
 
Reply With Quote
 
kazaam
Guest
Posts: n/a
 
      08-26-2007
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" <(E-Mail Removed)> 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 <(E-Mail Removed)>
 
Reply With Quote
 
Phlip
Guest
Posts: n/a
 
      08-26-2007
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


 
Reply With Quote
 
kazaam
Guest
Posts: n/a
 
      08-27-2007
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 <(E-Mail Removed)>
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
why why why why why Mr. SweatyFinger ASP .Net 4 12-21-2006 01:15 PM
findcontrol("PlaceHolderPrice") why why why why why why why why why why why Mr. SweatyFinger ASP .Net 2 12-02-2006 03:46 PM
501 PIX "deny any any" "allow any any" Any Anybody? Networking Student Cisco 4 11-16-2006 10:40 PM
asp2: setting UICulture via code does not work any more (always germanResources)? =?ISO-8859-1?Q?Roland_M=FCller?= ASP .Net 1 11-21-2005 09:14 AM
User question: JavaScript always erroring, any browser, any site Alex Rast Javascript 6 02-29-2004 07:59 PM



Advertisments