liberize / ssc

Convert shell script to binary
GNU General Public License v3.0
66 stars 21 forks source link

Is it possible: shebang that begins with env #28

Closed suntong closed 3 months ago

suntong commented 3 months ago

https://github.com/liberize/ssc/blob/80bbfba4cf855027f4d1e317cb65b0575ea3a193/examples/1_without_shebang/test.bash#L1-L2

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 commented 3 months ago

Yes, it's supported.

suntong commented 3 months ago

thanks, I'll give it try.

suntong commented 3 months ago

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

liberize commented 3 months ago

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

liberize commented 3 months ago

Currently, calls interpreter directly.

suntong commented 3 months ago

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 commented 3 months ago

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