diff --git a/lib/CustomCommands.pm b/lib/CustomCommands.pm index d6b9b54..5c7d7e9 100644 --- a/lib/CustomCommands.pm +++ b/lib/CustomCommands.pm @@ -46,7 +46,7 @@ sub handle { } # Check if it's a system command - my ($cmd_name) = split(/\s+/, $command); + my ($cmd_name, @args) = split(/\s+/, $command); #print STDERR "DEBUG: Checking system command: $cmd_name\n"; # Check PATH directly @@ -56,7 +56,7 @@ sub handle { my $pid = fork(); die "Fork failed: $!" unless defined $pid; if ($pid == 0) { # Child - exec($full_path, split(/\s+/, $command)) or die "Exec failed: $!"; + exec($full_path, @args) or die "Exec failed: $!"; } waitpid($pid, 0); # Wait for child return 2;