I am writing a bash script that must execute some kind of Java application that requires a specific class path.
In addition, this script must be run on both Ubuntu and Windows (Cygwin).
Problem: The separator on Windows is " ; ", and the separator on Ubuntu is " : ". This results java -cp A.jar;B.jar Mainin Windows (also when using cygwin because it uses java for Windows) and java -cp A.jar:B.jar Mainon Ubuntu.
Question: How to determine in bash script which operating system is running / which java classpath seperator to use?
source
share