Git Product home page Git Product logo

cscript's Introduction

CScript

An interpreter for 'C scripts' which can be executed directly in your shell.

Installation

Clone the repository and run the Makefile. Move the cs executable to your bin if you wish.

Usage

C scripts are designed to be similar in use to bash scripts, with the exception of using the C programming language. The syntax of these scripts have been modified from standard C syntax to best serve their purpose of creating quick and concise tools, while being fimiliar enough such that there is no extra overhead in getting accustomed to writing them.

The anatomy of a C script is as follows:

#!<path-to-cs-exec>
<includes>
<definitions>
<main code>
<functions>

Notice how there is no need for a main function declaration, only the code within. To provide further flexibilty and reduce the number of brain cycles spent on complying to C standards, the interpreter is also able to execute scripts where any of mentioned components of the script are meshed. For example, the following format would still be recognized:

#!<path-to-cs-exec>
<functions>
<includes>
<main code>
<definitions>
<more functions>
<more main code>

Note that if function A calls function B, function B should be placed before function A.

By including a shebang at the top of the script and ensuring executable permissions, the C script may be executed just as you would execute a bash script. An example script can be found here.

cscript's People

Contributors

automage avatar

Watchers

James Cloos avatar  avatar

cscript's Issues

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.