I am making a script that allow's me to unzip a given file. My problem is that i don't now how to change directory to the directory just created by the unzip process.
I tried with this command, but it's not working: SITE_DIRECTORY="$(ls -dt */ | head -1)"
Any idea on how to get the name of the directory just extracted ?
Edit: Now i got to SITE_DIRECTORY=unzip $SITE_NAME | grep 'creating:' | head -1 | cut -d' ' -f5-
But a new problem arise: the unzip command does not extract all the files. New ideas ?
The solution to my problem was the following commands:
Thanks goes to Evan @ Unzip File which directory was created