Module tells ScriptCs to ignore shebang line from parsing.
Without this module but with shebang in .csx file, you will get syntax error.
This module will be useful for scripting with ScriptCs on *nix systems.
- Install Mono
- Install ScriptCs for *nix systems: guide
- Create files in /usr/bin (or any other directory in your PATH) with this content:
scriptcs
#!/bin/sh
sciptcs_exe=<path to sciptcs.exe>
mono ${scriptcs_exe} $*
scriptcs_sh
#!/bin/bash
scriptcs $1 -- ${*:1}
- Make this files executable:
# In directory with scripts from above
chmod +x scriptcs
chmod +x scriptcs_sh
- Install ScriptCs.Shebang module globally:
scriptcs -i ScriptCs.ShebangModule -g
- Write example script: test.csx
#!/usr/bin/env scriptcs_sh
Console.WriteLine("Hello world");
- Make script executable:
chmod +x test.csx
- Now you can exec ScriptCs scripts just like any shell scripts. Enjoy!