Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

I actually had use for a polyglot script at work, since in .csproj files, <PreBuildEvent> is run as a "batch" cmd script on Windows, but with bash on Linux. The simplest trick I could find was this:

    rem () { ./bash-version.bash; exit $?; }
    rem skip rest of script if executed by bash
    rem batch script follows:
    IF %blah% EQU 0 etc.


Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: