Shebang line in Dart scripts

218 views
Skip to first unread message

Stuart Rackham

unread,
Aug 3, 2012, 8:35:07 PM8/3/12
to mi...@dartlang.org
The Dart VM appears to support a shebang line (the version I'm using
is Dart SDK version 10095) e.g.

  $ cat hello.dart
  #!/home/srackham/local/bin/dart/dart-sdk/bin/dart

  void main() {
    print("Hello World!");
  }

  $ ./hello.dart
  Hello World!

It's a great feature but I haven't seen it documented anywhere so my 
question is is it here to stay?

Cheers, Stuart

Stuart Rackham

unread,
Aug 3, 2012, 8:47:08 PM8/3/12
to mi...@dartlang.org
I've answered my question: yes, it goes under the name 'script tag' and it's in the language spec, apologies for the noise.

Bob Nystrom

unread,
Aug 6, 2012, 1:41:05 PM8/6/12
to Stuart Rackham, mi...@dartlang.org
Ah, my favorite kind of question on the mailing list: one where I don't have to answer it. :)

Thanks for figuring this out yourself and posting it here. That helps other Dart users who later run into this and search for help.

Cheers!

- bob

--
Consider asking HOWTO questions at Stack Overflow: http://stackoverflow.com/tags/dart
 
 

Reply all
Reply to author
Forward
0 new messages