[pve-devel] run_command and shellquote

Dietmar Maurer dietmar at proxmox.com
Tue Nov 4 18:39:56 CET 2014


> sub run_command {
>     my ($cmd, %param) = @_;
> 
>     my $old_umask;
>     my $cmdstr;
> 
>     if (!ref($cmd)) {
>         $cmdstr = $cmd;
>         if ($cmd =~ m/|/) {
>             # see 'man bash' for option pipefail
>             $cmd = [ '/bin/bash', '-c', "set -o pipefail && $cmd" ];
>         } else {
>             $cmd = [ $cmd ];
>         }
>     } else {
>         $cmdstr = cmd2string($cmd);

This $cmdstr is only used for logging!




More information about the pve-devel mailing list