Coder Social home page Coder Social logo

cronparser's Introduction

Cron Expression Parser

This is a C# project, containing a Cron Expression Parser, which supports the standard cron format with five fields, Minutes, Hour, Day of Month, Month and Day of Week, and as well as some of the operators , - * / .

This is runnable on Windows, Linux and macOS.

How to run it on macOS

First of all, we need to build our project and in order to do so, we will download Visual Studio from here https://visualstudio.microsoft.com/vs/mac/, install it (will take care and install .Net as well), open up our solution and build it.

Once that is done, we can navigate to the bin folder through command line (i.e. ../CronParser/CronParser/CronParser/bin/Debug) and run our .exe file as follows:

mono CronParser.exe */15 0 1,15 \* 1-5 /usr/bin/find

As you can notice, we had to escape the * symbol using the backslash, otherwise .NET thinks we want to know which files are in the folder. So please, when passing in the argument, if you're passing only * as a single argument, pass it as \* . All the other symbols are fine and work as expected (no need to escape for example */15)

The above examble produces the following output

minute          0 15 30 45
hour            0         
day of month    1 15      
month           1 2 3 4 5 6 7 8 9 10 11 12
day of week     1 2 3 4 5 
command         /usr/bin/find

Unit testing

Unfortunately, the console project is targeting .Net 4.7.2 framework, but on macOS we can only create create UnitTest projects targeting .Net Core, so our project is not testable on Linux based OS at the moment.

cronparser's People

Contributors

riadela avatar

Stargazers

Francesco Giusti avatar  avatar  avatar

Watchers

James Cloos avatar  avatar  avatar

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.