Une BĂ©vue wrote:
> Is tehre a way to test if a ruby script is run as a sudoer user ?
> 

on my system, echo $USER gives root under sudo (mac os x).

So in ruby:

ENV['USER']

will return root under sudo user, and my name normally.

Note that here i have done a "sudo bash" first.

-- 
Posted via http://www.ruby-forum.com/.