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

Please add a "shebang" into script #65

Open
znoxx opened this issue Apr 4, 2022 · 4 comments
Open

Please add a "shebang" into script #65

znoxx opened this issue Apr 4, 2022 · 4 comments

Comments

@znoxx
Copy link

znoxx commented Apr 4, 2022

Calling script in linux shell as simple executable leads to some unpredictable results, since shebang is missing

#!/usr/bin/env python3 for example.

./gogrepoc.py fails

python3 ./gogrepoc.py works

@Kalanyr
Copy link
Owner

Kalanyr commented Apr 4, 2022 via email

@znoxx
Copy link
Author

znoxx commented Apr 4, 2022

Thanks for reply.
Ok, fine, but may be to just add a note into readme for correct linux call ?

@Kalanyr
Copy link
Owner

Kalanyr commented Apr 4, 2022 via email

@pasbec
Copy link

pasbec commented Nov 17, 2022

Maybe a stupid comment to an old post but it might be useful for others:

Why not just create your own shortcut once?

Just go in to your gogrepoc directory (replace ${YOUR_DIRECTORY_OF_GOGREPOC} with your own):

cd ${YOUR_DIRECTORY_OF_GOGREPOC}

Then do soemthing like this:

echo "cd \$(dirname \"\$0\") && python3 ./gogrepoc.py" > gogrepoc
chmod +x gogrepoc

This way you could even save three characters (.py) when starting the tool:

./gogrepoc

You could even go one step further and add the gogrepoc directory to your PATH variable afterwards like this

echo "export PATH=\"${PWD}:\$PATH\"" >> ~/.bashrc

This saves you yet another two characters with the benefit of starting it from everywhere and whenever you want:

gogrepoc

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

3 participants