[KARAF-4564] [KARAF-4852] [KARAF-4865] Improve the main karaf script
 * use /bin/sh
 * do not rely on readlink, but use 'ls -l'
 * check exit code when changing directory
 * verify ulimit availability
 * use 'command -v' instead of 'type'
 * support spaces in the JAVA path
 * do not use {} expansion for file names
 * fix endorsed/ext dirs on cygwin/mingw
1 file changed