Quantcast
Channel: Active questions tagged ubuntu - Stack Overflow
Viewing all articles
Browse latest Browse all 6266

shebang under linux does not split arguments

$
0
0

I have kotlin script (but it can be any Linux command with arguments) for example:

#!/usr/bin/env kotlinc -scriptprintln("hello world")

When I run it in Ubuntu I get:

/usr/bin/env: ‘kotlinc -script’: No such file or directory

but when I run in command line:

/usr/bin/env kotlinc -script

It works. It is no problem with finding path because script:

#!/usr/bin/env kotlincprintln("hello world")

works

For some reason under Ubuntu "#!/usr/bin/env kotlinc -script" treats "kotlinc -script" as single argument. But only in shell script header.

I need explicitly to run my script "#!/usr/bin/env kotlinc -script" because I want it to run properly on other distributions end environments where "kotlin" is in $PATH.

Is there a bug in Ubuntu coreutils or sth? Is there a way to fix it?


Viewing all articles
Browse latest Browse all 6266

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>