要是可以在服务器端写as3,是不是一件很爽的事情~
我的实践:

1.下载对应版本的as3shebang

我的是linux 64位,所以我下载这个
github地址:https://github.com/Corsaair/as3shebang/releases/download/1.0.0/as3shebang_1.0.0_amd64.deb

2.安装

$ sudo dpkg -i as3shebang_1.0.0_amd64.deb

3.新建一个test文件

$ touch test

4.更改权限为可执行

$ chmod +x test

5.编辑脚本

$ nano test

6.test脚本里输入下面代码进行测试

#!/usr/bin/as3shebang

// Use AS3 to write some shell scripts :)
import shell.Program;
import shell.Runtime;

trace( "hello world" );

trace( "    Program.type = " + Program.type );
trace( "Program.filename = " + Program.filename );
trace( "startupDirectory = " + Program.startupDirectory );
trace( "    Program args = " + Program.argv );
trace( "" );
trace( "Redtamarin v" + Runtime.version + " " + (Runtime.is64bit() ? "64-bit": "32-bit" ) );

7. 运行脚本

$ ./test

8. 带参数执行

$ ./test a b c

参考地址:
http://blog.csdn.net/hero82748274/article/details/40679221
http://www.redtamarin.com/help/faq