Do you mean something like the code below? I tried that and it didn't work. Meaning it still produced one directory with the name "currentdate0 0 492mkdir otherdir1)"
my $cmd = "mkdir ";
$arg = "$(mkdir otherdir1)";
qx($cmd "currentdate$arg");
| [reply] [Watch: Dir/Any] [d/l] |
$arg = "$(mkdir otherdir1)";
Use single quotes in Perl, or the "$(" won't stick. And do something that produces output as well, to use in the name of the new directory.
$arg = '$(mkdir otherdir1; date +%F_%H.%M.%S)';
This also shows the need to cleanup (AKA "untaint") the user entered input data before just executing it. You could be executing a lot more than you bargained for. | [reply] [Watch: Dir/Any] [d/l] [select] |