Cross-platform command line script (e.g. .bat and .sh)
You could use this:
rem(){ :;};rem '
@goto b
';echo sh;exit
:b
@echo batch
It's valid shell script and batch, and will execute different blocks depending on how it's run.
Modify the echo
and @echo
lines to do what you want.