Skip to content

RaveNoX/ScriptCs.Shebang

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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!

About

*nix shebang support for ScriptCs

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages