HPUX::Ports

From HPUX.ch
Jump to: navigation, search

HPUX Ports

Go to ports.hpux.ch

rlwrap

rlwrap is a readline wrapper, a small utility that uses the GNU readline library to allow the editing of keyboard input for any other command. It maintains a separate input history for each command, and can TAB-expand words using all previously seen words and/or a user-specified file.

With rlwrap you are able to enable the sqlplus missing history function also under HP-UX.

To install it

  1. goto ports.hpux.ch and download rlwrap.
  2. swinstall the depots
  3. # swinstall -s /var/tmp/rlwrap_rlwrap.depot \*
    
  4. Add a sqlplus alias in your profile
  5. # vi ~/.profile
    # alias sqlplus="rlwrap sqlplus"
    

    or if you are working with the HPUX Tools the orasetenv command will detect if you have rlwrap installed and use it automaticaly.

  6. Have fun with the sqlplus history

sqsh

sqsh is short for SQshelL (pronounced s-q-shell), it is intended as a replacement for the venerable isql program supplied by Sybase. It came about due to years of frustration of trying to do real work with a program that was never meant to perform real work.

sqsh is much more than a nice prompt, it is intended to provide much of the functionality provided by a good shell, such as variables, redirection, pipes, back-grounding, job control, history, command completion, and dynamic configuration. Also, as a by-product of the design, it is remarkably easy to extend and add functionality.

sqsh was designed with portability in mind and has been successfully compiled on most major UNIX platforms supported by Sybase, such as Linux, FreeBSD, HP-UX, AIX, IRIX, SunOS, Solaris, Dynix, ...

To install it

  1. Make sure the sybase open client is installed on the hp-ux box
  2. goto ports.hpux.ch and download sqsh.
  3. Unzip the archive
  4. # cd /var/tmp
    # gunzip sqsh_sqsh-2.1.7-hpux-11.31.tar.gz
    # tar xvf sqsh_sqsh-2.1.7-hpux-11.31.tar
    
  5. Run the install script
  6. # cd sqsh-2.1.7
    # ./install.sh
    +============================================================+
    |                                                            |
    |             SQSH-2.1 BINARY INSTALLATION SCRIPT            |
    |                                                            |
    +============================================================+
    
    The following shell script will prompt you for several
    pieces of information required in order to properly install
    sqsh.  At any time during the installation process you may
    abort by hitting ^C at a prompt
    
    Hit ENTER to continue: 
    =================[ ROOT DIRECTORY ]======================
    
    Please input root directory in which the sqsh binary is to be
    installed. Typical locations are /usr, /usr/local, or /opt/sqsh.
    
    ==> Root installation directory [/usr/local] 
    
    =================[ GLOBAL CONFIGURATION ]======================
    
    With this release, sqsh allows a global sqshrc file to be
    installed to set default configuration values for all users.
    By default this file will be processed prior to each user's
    personal $HOME/.sqshrc file.  The global sqshrc file will
    be placed in the following directory.
    
    ==> Global sqshrc installation directory [/usr/local/etc] 
    
    ======================[ MANUAL PAGE ]==========================
    
    The following provides the location for the sqsh manual page.
    This page will be installed under the name sqsh.1 in the
    supplied location.  Note that any user wanting to read this
    manual should have this directory in their MANPATH environment
    variable
    
    ==> Manual installation directory [/usr/local/man/man1] 
    
    ======================[ WRAPPER SET-UP ]==========================
    
    With the binary only installation, a shell-script wrapper for
    sqsh is installed.  This wrapper does things such as set the
    $SQSHRC environment variable with the global sqshrc path
    supplied previously (/usr/local/etc). For the sake of less
    knowledgable individuals (or the sake the sanity of your
    system administrator), this script may also set your
    LD_LIBRARY_PATH or SHLIB_PATH environment variables.
    If you don't know what these variables do, answer 'y', below.
    
    ==> Set LD_LIBRARY_PATH or SHLIB_PATH in wrapper? [y] 
    
    The following LD_LIBRARY_PATH has been selected for you
    by examining your current operating environment for the
    libraries required to use the features that are currently
    compiled into your sqsh binary. If you wish to leave it 
    unchanged, simply hit enter, otherwise, enter an updated 
    path you wish to use instead.
    
    LD_LIBRARY_PATH = 
    ==> New path: /usr/local/lib
    
    ======================[ VERIFICATION ]==========================
    Root directory:             /usr/local
    Global sqshrc installation: /usr/local/etc/sqshrc
    Manual installation:        /usr/local/man/man1/sqsh.1
    Library Path:               /usr/local/lib
    
    ==> Are these settings correct? [y] 
    Here we go!
    Installing binary...
    Installing global sqshrc...
    Installing manual...
    Installing wrapper script...
    Done.
    
  7. Change the SYBASE variable in the file /usr/local/bin/sqsh
  8. # vi /usr/local/bin/sqsh
    SYBASE=/opt/sybase
    
  9. Add a sqsh alias in your profile
  10. # vi ~/.profile
    # alias sqsh="rlwrap sqsh"
    

You can also download the source and compile it on your HP-UX 11.31:

  1. Download the source from http://www.sqsh.org
  2. Configure the sources
  3. # ./configure
    
  4. Adjust the src/Makefile
  5. SYBASE_LIBS   =  -lsybblk64 -lsybcs64 -lsybct64 -lsybtcl64 -lsybcomn64 -lsybintl64 -lcl -lm -lsec
    ...
    CC             = gcc
    ...
    CFLAGS         = -mlp64 -DSYB_LP64 $(DEBUG) $(DEFINES) $(INCLUDE_DIRS)
    ...
    LDFLAGS        = -mlp64 -DSYB_LP64 $(DEBUG) $(LIB_DIRS)
    ...
    
  6. Execute make
  7. # make
    
  8. Install it
  9. # make install
    
# gcc --version
gcc (GCC) 4.6.0
Copyright (C) 2011 Free Software Foundation, Inc.
Views
Personal tools