Created
February 22, 2014 04:05
-
-
Save kunst1080/9148550 to your computer and use it in GitHub Desktop.
tr args '\n'
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@if (1==1) /* | |
@echo off | |
if "%~1"=="" goto :USAGE | |
if "%~1"=="/?" goto :USAGE | |
:MAIN | |
CScript //nologo //E:JScript "%~f0" %* | |
If ERRORLEVEL 1 goto :USAGE | |
goto :eof | |
:USAGE | |
echo USAGE: | |
echo %~n0 セパレータ | |
echo 標準入力を指定されたセパレータで分割し改行します。 | |
echo. | |
goto :eof | |
rem */ | |
@end | |
//---------------------------------------------------------- | |
if (WScript.Arguments.Lrngth == 0) | |
WScript.Quit(9); | |
var re = new RegExp(WScript.Arguments(0), "g"); | |
var s = WScript.StdIn.ReadAll(); | |
WScript.StdOut.Write(s.replace(re,"\r\n")); | |
WScript.Quit(0); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment