Giter Site home page Giter Site logo

xvoland / extract Goto Github PK

View Code? Open in Web Editor NEW
461.0 23.0 84.0 158 KB

Bash/Zsh function for extract: .zip, .rar, .bz2, .gz, .zlib, .tar, .tbz2, .tgz, .Z, .7z, .xz, .exe, .tar.bz2, .tar.gz, .tar.xz, etc.

License: MIT License

Shell 100.00%
extract shell-script shell-scripts bash bash-script archives command-line command-line-tool console-tool utils

extract's People

Contributors

beyondmeh avatar comedytomedy avatar git-em avatar monyarm avatar reox avatar scotho3 avatar supersandro2000 avatar xapn avatar xvoland avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

extract's Issues

DMG files

Sorry, don't know how to pull-request, but DMG (Apple Disk iMaGe, like an ISO) is an archive format that can be opened with 7z, so I just added it to the case statement:

.7z|.dmg)

Invalid path argument given to uncompression programs

Since commit 2f89a4a and the "make dir" removal the function gives invalid compressed file path to uncompression programs. ../"$1" should be either transformed to "$1" or turned into a variable (path for instance) :

local path="$1"
# local basename=${1%.*}
# mkdir $basename && cd $basename 
# path="../$1"

extract multiple files

Today I ran:

extract *.zip

but it extracted only the first archive.

Would it be possible to incorporate multiple files extraction?

gzip: stdin: not in gzip format

If .tar not compressed whith gzip:

zip: stdin: not in gzip format
tar: Child returned status 1
tar: Error is not recoverable: exiting now
touch hello.txt
tar -cvf foo.tar hello.txt
tar -czvf foo2.tar hello.txt
file foo*
foo.tar: POSIX tar archive (GNU)
foo2.tar:  gzip compressed data, from Unix, original size modulo 2^32 10240

Extract on PATH

Would you accept patches to make this executable instead?

I am locally making it "executable", but

Extract/extract.sh

Lines 4 to 5 in dda4c33

SAVEIFS=$IFS
IFS=$(echo -en "\n\b")
lines confuse me as how to handle it (or why are they there in the first place).

I think that 42c38af should be solved "externally" [i.e. user is responsible to give a correct path], rather you trying to "mask" it.

adding this to npm?

Would you be interested in adding to this a nodejs npm package, so that it can be easier to install globally? (basically a helper for workstation stuff)

I suppose it would be installed via:

npm install -g extract-cli

What if file has a space character in filename?

Hi,

This extractor works great but if the filename has a space character it fails to extract even if I use " or '.
It says file not exists because it tried to use only the sup before the first space.

If it's not possible due to bash limitation it would be helpful to mention it in README.

Log Files

Awesome Requirements Fulfilled with this Extractor.

Are there any Workarounds to have a logs file to save logs in /var/log directory? Thanks in advance if you can help here.

bash script and function confusion

Hello correct me if I'm wrong but,

  • doing PATH=script_dir/extract.sh:$PATH seems highly irregular
  • It doesn't actually work, the bash function extract is not being run anywhere

I propose to change the README.md so that the installation step of adding the file to path is:

export PATH="<path_to_file>":"$PATH"

("$PATH" so that any possible preexisting spaces in the path are properly escaped)
and that the extract.sh has an additional line:

extract "$@"

problem of extract .tar file

in tar version of 1.26, extract a .tar file with tar zxvf have error of

gzip: stdin: not in gzip format
tar: Child returned status 1
tar: Error is not recoverable: exiting now

and .tar file must extract with tar xvf in version of 1.26

Include a LICENSE

The README.md does specify the MIT license, but you should include the license text since the MIT license requires it be provided in order for others to use your code:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

Preferably, it should be in a separate LICENSE file. Plus, GitHub will give you a nifty little icon in the top commit bar, if you do use a LICENSE file.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.