https://github.com/ravenox/scriptcs.shebang
*nix shebang support for ScriptCs
https://github.com/ravenox/scriptcs.shebang
Last synced: 3 months ago
JSON representation
*nix shebang support for ScriptCs
- Host: GitHub
- URL: https://github.com/ravenox/scriptcs.shebang
- Owner: RaveNoX
- License: mit
- Created: 2014-12-11T17:43:35.000Z (over 10 years ago)
- Default Branch: master
- Last Pushed: 2014-12-11T18:26:57.000Z (over 10 years ago)
- Last Synced: 2025-04-13T22:08:01.103Z (3 months ago)
- Language: C#
- Size: 578 KB
- Stars: 2
- Watchers: 1
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE.md
Awesome Lists containing this project
README
ScriptCs.Shebang
================[Shebang](http://en.wikipedia.org/wiki/Shebang_(Unix)) support for [ScriptCs](http://scriptcs.net/)
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](http://scriptcs.net/) on *nix systems.
Installation
------------
1. Install [Mono](http://www.mono-project.com/download/)
2. Install [ScriptCs](http://scriptcs.net/) for *nix systems: [guide](https://github.com/scriptcs/scriptcs/wiki/Installing-on-Mac-and-Linux)
3. Create files in /usr/bin (or any other directory in your PATH) with this content:**scriptcs**
```bash
#!/bin/sh
sciptcs_exe=
mono ${scriptcs_exe} $*
```
**scriptcs_sh**
```bash
#!/bin/bash
scriptcs $1 -- ${*:1}
```4. Make this files executable:
```sh
# In directory with scripts from above
chmod +x scriptcs
chmod +x scriptcs_sh
```
5. Install ScriptCs.Shebang module globally:
```sh
scriptcs -i ScriptCs.ShebangModule -g
```6. Write example script:
**test.csx**
```csharp
#!/usr/bin/env scriptcs_sh
Console.WriteLine("Hello world");
```
7. Make script executable:
```sh
chmod +x test.csx
```
8. Now you can exec ScriptCs scripts just like any shell scripts. Enjoy!