- or download this
Example 3: Executing command with user bin's Environment and
Permissions
...
missions of user bin, type:
example% su - bin -c "command args"
- or download this
su - myuser -c "/home/myuser/t1.pl"
- or download this
#!/usr/bin/perl -w
use strict;
...
print OUT "user $ENV{'USER'}\n";
close(OUT) or die;
exit;