xvoland / Extract

Bash/Zsh function for extract: .zip, .rar, .bz2, .gz, .zlib, .tar, .tbz2, .tgz, .Z, .7z, .xz, .exe, .tar.bz2, .tar.gz, .tar.xz, etc.
MIT License
468 stars 83 forks source link

bash script and function confusion #34

Open ruzito opened 2 months ago

ruzito commented 2 months ago

Hello correct me if I'm wrong but,

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 "$@"
ComedyTomedy commented 1 month ago

The readme is auto-generated with ChatGPT or similar, and yes it's completely wrong.

The script intentionally defines a function, you're supposed to source it in your shell's config file, for example put . path/to/extract.sh in ~/.bashrc.

Mine is:

source ~/.local/bin/extract.sh
alias x=extract