Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Shell script cleanup

  • Loading branch information...
commit 075603fe1424b72d29e3987850aad7fb37176cc0 1 parent 2b5b58e
@goj goj authored krestenkrab committed
Showing with 36 additions and 57 deletions.
  1. +9 −7 boot_otp.sh
  2. +4 −26 ej
  3. +7 −24 ejc
  4. +16 −0 env_cfg
View
16 boot_otp.sh
@@ -1,16 +1,18 @@
+#!/bin/bash
-if [ "x${OTPROOT}" == "x" ]; then
- OTPROOT=/sw/lib/erlang
-fi
+EJC_CMD=`which "$0"`
+EJC_DIR=`dirname "$EJC_CMD"`
+EJC_BIN=`readlink -m "$EJC_DIR"`
+
+source $EJC_BIN/env_cfg
java -ea -cp erjang-0.1.jar \
- -Derjpath=$OTPROOT/lib/erts-5.7.3/ebin erjang.OTPMain \
- $OTPROOT/erts-5.7.3/bin/erl \
+ -Derjpath=$ERL_ROOT/lib/erts-$ERTS_VSN/ebin erjang.OTPMain \
+ $ERL_ROOT/erts-$ERTS_VSN/bin/erl \
-- \
-boot start \
- -root $OTPROOT \
+ -root $ERL_ROOT \
-progname erl \
-home $HOME \
-init_debug \
-loader_debug
-
View
30 ej
@@ -3,28 +3,11 @@
## Script to run the ERLConsole
##
-## Config: Which version of the Erlang Runtime System ?
-##
-ERTS_VSN=5.8
-
-## Config: Where to find ${ERL_ROOT}/lib/erts-${ERTS_VSN}
-##
-ERL_ROOT=/Users/krab/Projects/otp-5.8
-
-###########################################################
-
-EJC_CMD=$0
-while [ -h "$EJC_CMD" ]; do
- ls=`ls -ld "$EJC_CMD"`
- link=`expr "$ls" : '.*-> \(.*\)$'`
- if expr "$link" : '/' > /dev/null; then
- EJC_CMD="$link"
- else
- EJC_CMD="`dirname $EJC_CMD`/$link"
- fi
-done
+EJC_CMD=`which "$0"`
+EJC_DIR=`dirname "$EJC_CMD"`
+EJC_BIN=`readlink -m "$EJC_DIR"`
-EJC_BIN=`dirname "$EJC_CMD"`
+source $EJC_BIN/env_cfg
java -server -da \
-Derj.threads=1 \
@@ -33,8 +16,3 @@ java -server -da \
-root $ERL_ROOT \
+e $ERTS_VSN \
$*
-
-
-
-
-
View
31 ejc
@@ -1,37 +1,20 @@
-#!/bin/sh
+#!/bin/bash
## Script to run the ERLConsole
##
-## Config: Which version of the Erlang Runtime System ?
-##
-ERTS_VSN=5.8
-
-## Config: Where to find ${ERL_ROOT}/lib/erts-${ERTS_VSN}
-##
-ERL_ROOT=/Users/krab/Projects/otp-5.8
-
-###########################################################
-
-EJC_CMD=$0
-while [ -h "$EJC_CMD" ]; do
- ls=`ls -ld "$EJC_CMD"`
- link=`expr "$ls" : '.*-> \(.*\)$'`
- if expr "$link" : '/' > /dev/null; then
- EJC_CMD="$link"
- else
- EJC_CMD="`dirname $EJC_CMD`/$link"
- fi
-done
+EJC_CMD=`which "$0"`
+EJC_DIR=`dirname "$EJC_CMD"`
+EJC_BIN=`readlink -m "$EJC_DIR"`
-EJC_BIN=`dirname "$EJC_CMD"`
+source $EJC_BIN/env_cfg
exec java \
-server \
-Xss1m \
-Xmx2g \
- -Xdock:icon=$EJC_BIN/erjang_logo4.png \
- -Xdock:name="Erjang Console" \
+ $OSX_DOCK_ICON \
+ $OSX_DOCK_NAME \
-Derj.threads=1 \
-cp $EJC_BIN/erjang-0.1.jar erjang.console.ERLConsole \
-root "$ERL_ROOT" \
View
16 env_cfg
@@ -0,0 +1,16 @@
+# set the defaults if there is no environment variable
+
+if [[ ${ERTS_VSN-x} ]]; then
+ ERTS_VSN=5.8
+fi
+if [[ ${ERL_ROOT-x} ]]; then
+ ERL_ROOT=/Users/krab/Projects/otp-5.8
+fi
+
+###########################################################
+
+# OS X - specific config
+if [[ $(uname) == "Darwin" ]]; then
+ OSX_DOCK_ICON=-Xdock:icon=$EJC_BIN/erjang_logo4.png
+ OSX_DOCK_NAME=-Xdock:name="Erjang Console"
+fi
Please sign in to comment.
Something went wrong with that request. Please try again.