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

bash script and function confusion #34

Open
ruzito opened this issue Jun 11, 2024 · 1 comment
Open

bash script and function confusion #34

ruzito opened this issue Jun 11, 2024 · 1 comment

Comments

@ruzito
Copy link

ruzito commented Jun 11, 2024

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 "$@"
@ComedyTomedy
Copy link
Contributor

ComedyTomedy commented Jul 16, 2024

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

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