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);
Question
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
Solution
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);