https://github.com/keidrun/l2l-batchtobash-plugin
L2L plugin for the conversion from the windows batch program to the linux bash program.
https://github.com/keidrun/l2l-batchtobash-plugin
bash batch l2l l2l-plugin plugin
Last synced: about 1 month ago
JSON representation
L2L plugin for the conversion from the windows batch program to the linux bash program.
- Host: GitHub
- URL: https://github.com/keidrun/l2l-batchtobash-plugin
- Owner: keidrun
- License: mit
- Created: 2017-04-01T20:42:38.000Z (over 9 years ago)
- Default Branch: master
- Last Pushed: 2017-10-19T14:55:50.000Z (over 8 years ago)
- Last Synced: 2025-01-23T09:41:56.459Z (over 1 year ago)
- Topics: bash, batch, l2l, l2l-plugin, plugin
- Language: Java
- Size: 96.7 KB
- Stars: 0
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# l2l-BatchToBash-plugin
[![tests][tests]][tests-url]
[![coverage][cover]][cover-url]
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.
```groovy
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
```bat
@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
```bash
#!/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
[tests]:https://travis-ci.org/keidrun/l2l-BatchToBash-plugin.svg?branch=master
[tests-url]:https://travis-ci.org/keidrun/l2l-BatchToBash-plugin
[cover]:https://codecov.io/gh/keidrun/l2l-BatchToBash-plugin/branch/master/graph/badge.svg
[cover-url]:https://codecov.io/gh/keidrun/l2l-BatchToBash-plugin