in reply to Obtaining %ENV values via su cmd
Try using Data::Dumper to see what is in %ENV, it is posible that user bin explicity unsets USER or some other shenanigains. This is the output that I get on my box (Dapper drake server).
env.pl, the test scriptAnd the output:#!/usr/bin/perl -w use strict; use Data::Dumper; print Dumper(\%ENV);
trizor@trap:/home$ sudo su - greg -c /home/env.pl $VAR1 = { 'HOME' => '/home/greg', 'LOGNAME' => 'greg', 'SHLVL' => '1', '_' => '/home/dummy.pl', 'SHELL' => '/bin/bash', 'TERM' => 'xterm', 'PWD' => '/home/greg', 'USER' => 'greg', 'LANG' => 'en_US.UTF-8' };
As you can see, USER is there plain as day.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Obtaining %ENV values via su cmd
by chrism01 (Friar) on May 14, 2007 at 23:47 UTC | |
by graff (Chancellor) on May 15, 2007 at 02:21 UTC | |
by chrism01 (Friar) on May 15, 2007 at 04:57 UTC | |
by Trizor (Pilgrim) on May 15, 2007 at 00:51 UTC | |
by Tanktalus (Canon) on May 15, 2007 at 05:44 UTC |