chrism01 has asked for the wisdom of the Perl Monks concerning the following question:
and I run the cmd (from root)Example 3: Executing command with user bin's Environment and Permissions To execute command with the temporary environment and per- missions of user bin, type: example% su - bin -c "command args"
on filesu - myuser -c "/home/myuser/t1.pl"
but get error#!/usr/bin/perl -w use strict; open(OUT,">su-test.log") or die; print OUT "user $ENV{'USER'}\n"; close(OUT) or die; exit;
Use of uninitialized value in concatenation (.) or string at /home/myuser/t1.pl line 5.
Any ideas, ie why doesn't it work as per man page?
Cheers
Chris
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Obtaining %ENV values via su cmd
by Trizor (Pilgrim) on May 14, 2007 at 23:28 UTC | |
by chrism01 (Friar) on May 14, 2007 at 23:47 UTC | |
by Trizor (Pilgrim) on May 15, 2007 at 00:51 UTC | |
by Tanktalus (Canon) on May 15, 2007 at 05:44 UTC | |
by graff (Chancellor) on May 15, 2007 at 02:21 UTC | |
by chrism01 (Friar) on May 15, 2007 at 04:57 UTC | |
|
Re: Obtaining %ENV values via su cmd
by rev_1318 (Chaplain) on May 15, 2007 at 22:36 UTC |