Help for this page

Select Code to Download


  1. or download this
    #my @command = ("su - $user -c id")  
    ####################################
    #system ("su - $user"); #this Works#
    ...
    #system ("su - $user -c /bin/bash -c $action");
    #system "sudo","su","-" => $user, -c =>  $action;
    
  2. or download this
    use warnings;
    use diagnostics;
    ...
    say "$user";
    say "$action ";
    print $sh->sudo("su -l - $user --command $action");