digitalmars.D.learn - why --shebang for rdmd?
- Shriramana Sharma (9/9) Nov 20 2015 Hello. The following code works fine for me:
- Marc =?UTF-8?B?U2Now7x0eg==?= (15/22) Nov 21 2015 Here's the source:
Hello. The following code works fine for me: import std.stdio; void main() { writeln(2); } So what is the use of the --shebang option of rdmd? http://dlang.org/rdmd.html does not shed much light on this. Thanks. --
Nov 20 2015
On Saturday, 21 November 2015 at 05:20:16 UTC, Shriramana Sharma wrote:Hello. The following code works fine for me: import std.stdio; void main() { writeln(2); } So what is the use of the --shebang option of rdmd? http://dlang.org/rdmd.html does not shed much light on this. Thanks.Here's the source: https://github.com/D-Programming-Language/tools/blob/master/rdmd.d#L59-L64 Linux has a restriction for shebang lines: There can only be only command line argument. E.g.: // foo.d When running ./foo.d, the kernel would execute rdmd with the following arguments: ["/usr/bin/rdmd", "--compiler=/usr/bin/dmd --loop", "./foo.d"] I.e., the entire command line after the executable is merged into one argument. With `--shebang`, rdmd splits the argument before processing it. That's how I understand it, anyway.
Nov 21 2015