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

Is it possible: shebang that begins with env #28

Closed
suntong opened this issue Aug 4, 2024 · 7 comments
Closed

Is it possible: shebang that begins with env #28

suntong opened this issue Aug 4, 2024 · 7 comments

Comments

@suntong
Copy link

suntong commented Aug 4, 2024

# doesn't require a shebang
# bash in PATH will be called

Many *nix based script use shebang that begins with env, like for my perl script, I'll begin them with

#! /usr/bin/env -S perl -p

Would such scripts be supported, even if they don't have the proper extension with them? thx

@liberize
Copy link
Owner

liberize commented Aug 5, 2024

Yes, it's supported.

@suntong
Copy link
Author

suntong commented Aug 5, 2024

thanks, I'll give it try.

@suntong suntong closed this as completed Aug 5, 2024
@suntong
Copy link
Author

suntong commented Aug 5, 2024

BTW, internally, would the compiled executable call env or call the interpreter directly?

@liberize
Copy link
Owner

liberize commented Aug 5, 2024

Only support /usr/bin/env without any flags...

@liberize
Copy link
Owner

liberize commented Aug 5, 2024

Currently, calls interpreter directly.

@suntong
Copy link
Author

suntong commented Aug 5, 2024

Only support /usr/bin/env without any flags...

You meant without any flags to env or to the interpreter instead?

As Perl scripts uses to put more flags on the shebang line.

@liberize
Copy link
Owner

liberize commented Aug 5, 2024

Without any flags to env.
Currently if /usr/bin/env is found, it will be dropped directly.

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