Skip to content

L2L plugin for the conversion from the windows batch program to the linux bash program.

License

Notifications You must be signed in to change notification settings

keidrun/l2l-BatchToBash-plugin

Repository files navigation

l2l-BatchToBash-plugin

tests coverage

L2L plugin for the conversion from the windows batch program to the linux bash program.

Installation by Gradle

You add the following configuration to your build.gradle file. ${version} is the release version.

repositories {
    jcenter()
}

dependencies {
    compile "com.keidrun.l2l-BatchToBash-plugin:l2l-BatchToBash-plugin:${version}"
}

Example of the Conversion from the Windows BATCH to the Linux BASH

Input: BATCH program

@echo off
cd /d %~dp0

set ARG=%1

if %ARG%==1 (
    echo 1
) else if %ARG%==2 (
    echo 2
) else (
    echo 3
)

for %%i in (*.txt) do (
    type %%i
)

pause

Output: BASH program

#!/bin/bash
cd `dirname $0`

ARG=$1

if [ ${ARG} -eq 1 ]; then
    echo 1
elif [ ${ARG} -eq 2 ]; then
    echo 2
else
    echo 3
fi

for i in `ls *.txt`; do
    cat $i
done

read -p "Press [Enter] key to resume."

Not yet implemented list

  • for options
  • goto and :LABEL
  • if command
  • setlocal and endlocal
  • set enabledelayedexpansion and !value!
  • %~value
  • shift
  • errorlevel
  • defined
  • call
  • tokens
  • Other DOS commands's details

About

L2L plugin for the conversion from the windows batch program to the linux bash program.

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages