From: Rahul Kumar Date: 2010-10-07T16:03:06+09:00 Subject: Re: testing if a script is run via sudo 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/.