
saphire shell


What is this software?

    a shell with text processing inner commands under linux.

Compiled and tested saphire below Operating systems
    Debian 6
    OSX 10.7.0
    cygwin 1.7.9
    Oracle Solaris 11 Express
    FreeBSD 8.2

ATTENSION
    Use this software on your own risk. Don't use this under importnat systems. I can't take a responsibility on your works with saphire.

How to compile
    Before compiling saphire, you need to resolve dependencies below. You need development packages below.(ex. ncurses-devel or libncurse-dev)

    gcc 
    libc
    libm 
    ncurses
    readline
    oniguruma (which is a fast regex library)
    libgc
    C/migemo (which is used by romaji completion. If you are Japanese, you may need this library)
    lv (which is needed by shelp inner command)

    Do you installed above libraries? You can type below commands to compile saphire.

    ./configure 
    make
    sudo make install

    or

    ./configure
    make
    su
    make install

    Default prefix is /use/local/bin, so you need a root comission.

    If you want to change installed directory, type below

    sudo make DESTDIR=??? install

    When you chise normal install, installed saphiresh to /usr/local/bin and setting files to /usr/local/etc.

    configure options are below.

    --prefix --> indicate installed directory. If you use --prefix=$HOME, saphire will be installed $HOME/bin, $HOME/etc. As default, prefix is /usr/local.
    --with-optimize --> compiled with optimize. Fast binary will be made.
    --with-migemo --> enable C/Migemo which is Romaji completion for Japanese.
    --with-onig-dir --> indicate oniguruma installed directory.
    --with-migemo-dir --> indicate C/Migemo installed directory.
    --with-readline-dir --> indicate readline installed directory.
    --with-gc-dir indicate Boehm GC installed directory.
    --with-system-migemo-dir indicate C/Migemo dictionary directory.
    --with-debug --> give -g option to CFLAGS.
    --with-gprof-debug --> give -pg option to CFLAGS

    saphire makes library, so add /usr/local/lib(or your installed directory)  to /etc/ld.so.conf and type below to refresh dynamic loarding searched path cache.
    
    sudo ldconfig
    
    or

    su
    ldconfig
    

    If you don't have root comission, add the path to LD_LIBRARY_PATH environment variable. (With OSX, you should use DYLD_LIBRARY_PATH_FALLBACK environment variable.)

with OS X
    Before you installed saphire, you should compile readline library because OSX's readline is libedit, saphire need GNU readline.
    Also you can use Macports instead of manually compiling to install GNU readline.


Used files
    /usr/local/bin/saphire --> a program
    /usr/local/bin/saphiresh --> a interactive shell
    /usr/local/etc/saphire.sa --> a source setting file
    /usr/local/etc/saphire.sao --> a compiled setting file
    ~/.saphire/.saphire.sao --> a compiled user setting file. Saphire read this after /usr/local/etc/saphire.sao.
    ~/.saphire/.history --> a command line history file
    ~/.saphire/tmp --> Temporary directory used by saphire.
    /usr/local/share/migemo/{utf-8,eucjp.sjis}/{han2zen.dat,hira2kana.dat,migemo-dict,roma2hira.dat} --> migemo dictionary files
    /usr/share/cmigemo/{utf-8,eucjp.sjis}/{han2zen.dat,hira2kana.dat,migemo-dict,roma2hira.dat} --> migemo dictionary files

Encoding and Line field
    Saphire script source file must be written with UTF-8 encode and LF Linefield. Saphire can treat UTF8, EUCJP, and SJIS encodings and can treat LF, CR, LFCR line fields.
    You should run saphiresh as interactive shell on UTF-8 terminal.

Usage
    You can use saphiresh as a interactive shell with readline, and can use saphire as a acript engine. saphire is faster than saphiresh as a script engine because saphiresh loads readline.
    When using saphiresh, you can run shelp to read saphire usage.

Embbeded for aplications
    You can use saphire as a embbeded acript engine for applications.
    See main.c and saphire.h.

Files
    AUTHORS
    CHANGELOG.txt --> a changing log
    GPL --> LINCENSE
    Makefile --> used by make
    Makefile.in --> Source of Makefile
    README.ja.txt --> Japanese README
    README.en.txt --> This file
    USAGE.ja.txt --> Japanese Usage
    USAGE.en.txt --> Usage
    config.h --> output of configure
    config.h.in --> source of config.h
    config.log --> configure log
    config.status --> related configure
    configure --> configure program
    configure.in --> source of configure
    install.sh --> used by configure
    saphire.h --> saphire header file
    saphire.sa --> saphire run time script
    saphire_commands.c --> saphire inner command
    saphire_inner.h --> saphire inner header
    saphire_main.c --> saphire extra functions
    saphire_parser.c --> saphire parser
    saphire_vm.c --> saphire main function
    main.c --> saphire interactive shell program
    saphire_curses.c --> original terminal library
    saphire_curses.h
    saphire_debug.c --> debug library
    saphire_debug.h
    saphire_extra.c --> extra library
    saphire_extra.h
    saphire_hash.c --> hash container library
    saphire_hash.h
    saphire_kanji.c --> Japanese image character library
    saphire_kanji.h
    saphire_list.c --> list container library
    saphire_list.h
    saphire_string.c --> string library
    saphire_string.h
    saphire_vector.c --> vector library
    saphire_vector.h
    readline.c --> related to readline

LINCENSE
    GPL.
