From Glenn's reply:
Read your
execve(2)
man page. The limitation on a single optional argument is OS dependent. Linux treats all words after the interpreter as one single argumentIf you want to do this:
#! /path/to/interpreter arg1 arg2 arg3
You should in fact do this
#!/bin/sh exec /path/to/interpreter arg1 arg2 arg3 "$@"
If I want to write a script which contains some code in the script language,:
#! /path/to/interpreter arg1 arg2 arg3
<script content in the script language>
according to Glenn's reply, I should instead write the script as:
#!/bin/sh
exec /path/to/interpreter arg1 arg2 arg3 "$@"
Then where should I write <script content in the script langauge>
? Since it is written in the script language but not in the shell language, so it can't be placed in the the shell script, correct? Where should I place it?
Thanks.
<<
is (wholly) unquoted. This is explained in the wikipedia page you linked, or e.g. https://www.gnu.org/software/bash/manual/html_node/Redirections.html#Here-Documents – dave_thompson_085 Apr 07 '18 at 04:26