perl -e 'my $p; mkdir $_ foreach(grep {!-d} map {$p .= "/$_";} grep {!m/^$/} split(/\//,$path));