Multiline shebang: Difference between revisions

Line 93:
 
=={{header|Tcl}}==
It is normal to use a line like this:
{{incorrect|Tcl|This is not a multiline shebang. A plain #! can only have one line.}}
Note that the binary is tclsh.
 
<lang tcl>#!/usr/bin/env tclsh</lang>
But in cases where that is not enough — perhaps because it needs some logic to locate the Tcl interpreter to use — the differences in the way Tcl and the Bourne shell interpret end-of-line backslashes in comments can be used:
<lang tcl>#!/bin/sh
# Next line is comment in Tcl, but not in sh... \
tclsh "$0" ${1+"$@"}</lang>
Additional complexity can be added so long as the lines for the shell are commented in a Tcl sense.
Anonymous user