Skip to content
Zwetan Kjukov edited this page Sep 29, 2017 · 2 revisions

When you use as3shebang

#!/usr/bin/as3shebang

import shell.*;
trace( "hello world" );
trace( "args:" + Program.argv );

usage:
$ ./myscript and $ ./myscript one two 1 2

This is the "default" as it is where we install the as3shebang executable by default.

Alternative One for as3shebang

#!/usr/bin/env as3shebang

import shell.*;
trace( "hello world" );
trace( "args:" + Program.argv );

usage:
$ ./myscript and $ ./myscript one two 1 2

This is a bit "better" and in some case "more portable".

By using /usr/bin/env it will returns any as3shebang found in the current user path, some consider this better as it avoid to hardcode the path to the as3shebang executable and so allow to run multiple versions in parallel.

But for the very same reasons it could be considered "not better", your experience may vary.

Alternative Two for as3shebang

#!/opt/local/bin/as3shebang

import shell.*;
trace( "hello world" );
trace( "args:" + Program.argv );

usage:
$ ./myscript and $ ./myscript one two 1 2

You can point directly to an as3shebang executable custom path.

Alternative One to the Shebang line

#!
':' //; exec "$(which as3shebang)" "$0" "$@"

import shell.*;
trace( "hello world" );
trace( "args:" + Program.argv );

usage:
$ ./myscript and $ ./myscript one two 1 2

It's more a trick than anything else but it will work.

Alternative Two to the Shebang line

':' //; exec "$(which redshell_dd)" "$0" "$@"

import shell.*;
trace( "hello world" );
trace( "args:" + Program.argv );

usage:
$ ./myscript and $ ./myscript one two 1 2

This will work too but then it will not really be considered a shell script as it is run through the redshell_dd executable instead of the as3shebang executable.