문제

I want to call from perl the command "touch" on a large list of files. The command I am using fails:

$cmd = "touch $list_of_files";
$ret=system("sudo -u user bash -c \"$cmd\"");
print $ret;

Is there a limitation of command length in bash or is it because I am using 'system'? Beside splitting the list of files in smaller lists is there a solution to my problem?

Thanks

도움이 되었습니까?

해결책

Is there a limitation of command length in bash

I believe so. But why are you suing bash at all?

system("sudo", "-u", "user", "touch", @list_of_files);
라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top