I've this command:
zip files/test.zip $(tar tf files/test.gz)
But it doesn't work because everything from $(tar tf files/test.gz) are in files/ So zip can't find it. It works perfectly if I change directory to files and exec this one:
zip test.zip $(tar tf test.gz)
But I need to make it work from parent directory.
My full command is:
tar xzf files/test.tar.gz && zip files/test.zip $(tar tf files/test.tar.gz) && rm -r -- $(tar tf files/test.tar.gz)
From Is there any command on Linux to convert .tar.gz files to .zip?
Thank you