DEV Community

[Comment from a deleted post]
Collapse
 
ifreund profile image
Isaac Freund

Nice trick! note that this will only work in some shells such as bash. If you pass the zig source file directly to the kernel as the argument of execve() the kernel won't run it sadly as it only understands #!/path.

Collapse
 
stein profile image
[moved]

Yeah, good point. Also works nicely in zsh, so I think it'll work for a lot of people.

Collapse
 
heavyrain266 profile image
HeavyRain266

Also works nicely in all type of kernshells such as mksh, also in busybox ash and more :)

 
stein profile image
[moved]

That's awesome - thanks!