I'm trying to write a script that extracts a tar.gz archive. I know that the archive will contain just a single folder at the top level, and that this folder will contain a directory structure under it. The name of the folder at the top level is not known.
I started by using
This still lists the entire directory structure, even though the --no-recursive option is given.Code:files = "$(tar --no-recursive -tf public_html/drupal-6.16.tar.gz)"
Finally if I cannot simply find the name of the top level directory, then how can I extract the first line from the output of the above command.
Thanks a lot in advance.
Vamega
Bookmarks