Created
December 7, 2017 19:39
-
-
Save secretsquirrel/b425e8490bc2dfcbf1f9f69f065ecc84 to your computer and use it in GitHub Desktop.
bash|batch
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
cat /tmp/test.sh | |
:; if [ -z 0 ]; then | |
@echo off | |
goto :WINDOWS | |
fi | |
if [ -z "$2" ]; then | |
echo "usage: $0 <firstArg> <secondArg>" | |
exit 1 | |
fi | |
# bash stuff | |
echo moo | |
exit | |
:WINDOWS | |
if [%2]==[] ( | |
SETLOCAL enabledelayedexpansion | |
set usage="usage: %0 <firstArg> <secondArg>" | |
@echo !usage:"=! | |
exit /b 1 | |
) | |
:: windows stuff | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment