Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[question] Extracting in a dir with the same name as the archive? #167

Open
rado84-github opened this issue Dec 29, 2021 · 1 comment
Open

Comments

@rado84-github
Copy link

Is there a way to make p7zip to extract the contents of an archive in a directory whose name is the same as the name of the archive? For instance, if the archive name is game1.zip, to extract the contents to "game1/". I know I could manually type the name but I need something that will automatically match the name of the archive along with the spaces in the name, if any.

@tansy
Copy link
Contributor

tansy commented Feb 10, 2022

You can get file without specifies extension ibn bash easily.

$ for FILEZIP in *.zip; do FILE={FILEZIP%.zip}; unzip -d $FILE $FILEZIP; done

Check parameter expansion in bash manual.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants