From: "Booker C.Bense" Date: 2007-04-26T05:15:18+09:00 Subject: Re: Is it possible to make system use bash instead of sh? -----BEGIN PGP SIGNED MESSAGE----- In article <335e48a90704250904y7c06bcb5s74b34cd86d92860e@mail.gmail.com>, Robert Dober wrote: >On 4/25/07, Wai Tsang wrote: > >Of course that is not exactly what you want, you would like to tell >Kernel or whatever other object that wants to hear that kind of >message: "You are going to use /bin/bash for system from now on". >So I went digging the code, no such luck, I just could not find the >definition of Kernel#system :( >neither with rb_define_method.*system >nor with def\s*system >and even less with >alias\s*system >or >rb_alias.*system >Hope that somebody more learned will help us out here. > _ Ruby uses the underlying C exec call and any system that does not use /bin/sh is severely broken. It's part of the POSIX standard. If you want bash, then use the multi-arg form of the command which bypasses shell interpretation entirely. If you want the gory details look in process.c rb_f_system _ Booker C. Bense -----BEGIN PGP SIGNATURE----- Version: 2.6.2 iQCVAwUBRi+0jmTWTAjn5N/lAQEwgAP/SrYiy/UhXzHGJ4G4FJwP9XV72ogYvfbO CyhpNvaMdeBJEVp7lGl+Dw84fLlsQY6Dh9HBnzsyLv0vkpnOHByeQc+GVB9KdMYh C91ilHEPXQdI2QJPlMmnUh4H+fvRs5NgoNXIORhE4lnbsVXBDIcl73mXY0kHU82z fL4OcNifcnM= =EJLT -----END PGP SIGNATURE-----