Created
September 27, 2018 13:45
-
-
Save xopr/bc6f4f2827d911457789af1f744e0e75 to your computer and use it in GitHub Desktop.
batch bash hybrid script
This file contains hidden or 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
:<<"::CMDLITERAL" | |
@ECHO OFF | |
echo Welcome to %COMSPEC% | |
GOTO :CMDSCRIPT | |
::CMDLITERAL | |
echo "Welcome to ${SHELL}" | |
function REM { | |
# REM is used to execute linux shell code | |
eval $* | |
} | |
function call { | |
# Do not do anything; call is for windows batch files | |
: | |
} | |
# Note the space | |
: CMDSCRIPT | |
call echo This will be displayed in windows command prompt | |
REM echo This will be displayed in linux shell prompt | |
echo This will be displayed on both systems |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
some (maybe better) alternatives: