Bash script
cm.sh
[-qnv]
[-e editor]
[-l lisp]
[-s sys]
[-P prefs]
[-O os]
[-A arch]
[-F lisp-flavor]
[-V version]
[-R cmroot]
Starts Common Music (cm) either by loading it into a fresh Lisp or Scheme session or by launching an existing Lisp image that has been built with Common Music pre-loaded. Additionally, this process can be run stand-alone in a terminal or as a subprocess of an Emacs-compatible editor such as xemacs(1), emacs(1), or gnuclient(1).
Since the script is designed to autodetect all required parameters at runtime, it should in virtually all cases suffice to call it without any arguments. This autodetection however may be customized or overridden via the following options and environment variables:
-h-q-n-v-e {editor}-l {lisp}-s {system}-P {prefs}-O {os}-A {arch}-F {lisp-flavor}-V {version}-R {cmroot}Environment variables:
CM_EDITOR-e option.
CM_RUNTIME-l option.
CM_RUNTIME_PREFSCM_RUNTIME_FLAVORs to try during
autodetection, in order of preference. Same as -r option.
CM_OS-O option.
CM_ARCH-A option.
CM_RUNTIME_FLAVORCM_RUNTIME or the -l option if the flavor can't be derived from
the command name or path. Same as -F
option.
CM_RUNTIME_VERSIONCM_RUNTIME or the -l option if the version can't be derived from
the command name or path. Same as -V
option.
CM_ROOT_DIR-R option.
For autodetection to work, it is important that the script be not moved from its location inside the Common Music directory tree. A 'cm' (or similar) command in a standard binary location can be easily provided either by creating a symlink (Example 1) or by creating a wrapper shell script (Example 2).
Example 1. Linking a system-wide command to cm.sh
% ln -s /path/to/cm/bin/cm.sh /usr/local/bin/cm
;; Wrapper shell script to start cm.sh #!/bin/sh exec /path/to/cm/bin/cm.sh # chmod 755 /usr/local/bin/cm
Requirements: bash(1), cat(1), cut(1), echo(1), head(1), sed(1), sort(1), tr(1), uname(1), which(1); getopts and ls; a working installation of a Lisp or Scheme runtime; the '-repl' option if clisp is used (clisp 2.31 or higher).