Seems like a stupid question, but I can't find anything via google or man page...I'm sure it's something with my quotes...When I run the following from the command line, it runs as expected/desired(i.e. only files without any directories):
tar cfz /path/to/file.tar.gz --directory="/path/to/" .
However, I have this analogous line in perl, albeit with a variable as the path ($folder_errors='/path/to'):
system('tar cfz '."\"${folder_errors}\"/errors.tar.gz --directory=\"\"${folder_errors}\"/\" .");
also tried
system('tar cfz '."\"${folder_errors}\"/errors.tar.gz --directory=\"${folder_errors}\"/ .");
with the same (unexpected) results.
It compresses the correct files, however, inside of the compressed file is the file structure ./
where all of the files reside.
Try perl's quote operators.
qq[...]
acts like double-quotes, except you don't have to escape the literal"
inside them.