Skip to content

Latest commit

 

History

History
57 lines (43 loc) · 1.33 KB

File metadata and controls

57 lines (43 loc) · 1.33 KB

ScriptCs.Shebang

Shebang support for ScriptCs

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.

Installation

  1. Install Mono
  2. Install ScriptCs for *nix systems: guide
  3. 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}
  1. Make this files executable:
# In directory with scripts from above
chmod +x scriptcs
chmod +x scriptcs_sh
  1. Install ScriptCs.Shebang module globally:
scriptcs -i ScriptCs.ShebangModule -g
  1. Write example script: test.csx
#!/usr/bin/env scriptcs_sh

Console.WriteLine("Hello world");
  1. Make script executable:
chmod +x test.csx
  1. Now you can exec ScriptCs scripts just like any shell scripts. Enjoy!