Skip to content

Instantly share code, notes, and snippets.

@guneemwelloeux guneemwelloeux/sles.log Secret
Created Jan 24, 2018

Embed
What would you like to do?
ZSH login traces
# set global options for all zsh shells here
export REPENV=/remote/tools/profiles_repository/zsh
# DO NOT EDIT THIS FILE !!!
# All your personal configuration should be done in .zshenv.<loginname>
# If for any reason you wish to bypass the standard process, you can create a
# .zshenv.override to set a custom environment, but DSP will not provide support
# in such a case.
if [ -e $HOME/.zshenv.override ]
then
file="$HOME/.zshenv.override"
else
file="$REPENV/buildenv"
fi
if [ -f $file ]
then
if tty -s
then
. $file
else
. $file > /dev/null
fi
fi
###############################
# -----------------------------
# This script is launched at user logon process so as to set up common development environment.
# Settings can be drawn up according to the following criteria :
#
# - settings shared by all Operating Systems or relating to a specific operating system (systems folder)
# - settings relating to a specific hostname
# - settings relating to common soft users
# - settings relating to a specific installed softs
# - settings relating to common (nas)tool users
# - settings relating to a specific installed (nas)tools
# - settings relating to common company users
# - settings relating to a specific group of users
# - settings relating to a specific group of projects
# - settings relating to a specific user
#
# Common server OS Settings
# -------------------------
if [ -f $REPENV/systems/zshenv.allsystems ]
then
. $REPENV/systems/zshenv.allsystems
fi
# Latest modification : 17/12/2k8 (DCC)
# Environment variables
# Update variables PATH, MANPATH and LD_LIBRARY_PATH
# ---------------------------------------------------
[[ -d /usr/local/bin ]] && export PATH=/usr/local/bin:$PATH
[[ -d /usr/share/man ]] && export MANPATH=$MANPATH:/usr/share/man
[[ -d /usr/local/man ]] && export MANPATH=$MANPATH:/usr/local/man
[[ -d /usr/local/lib ]] && export LD_LIBRARY_PATH=/usr/local/lib:$LD_LIBRARY_PATH
# ????? useless, these are system GLOBAL variables
# ------------------------------------------------
export USERNAME
export LOGNAME
export HOST
# Commented on : /etc/db_user_machine is not necessarilly up-to-date
# 17/12/2k8 and must be maintained on all boxes - DCC
# --------------------------------------------------------
#if [ "$DISPLAY" = "" ]
#then
# export DISPLAY=$(grep $USERNAME /etc/db_user_machine | awk '{print $2}'):0.0
#fi
TEST=`echo $DISPLAY | cut -f 1 -d:`
if [ "$TEST" != "localhost" ] # JFR March 2010 - For poeple who used X11 Forwarding with ssh tunneling
then
# New set of user DISPLAY - DCC 17/12/2k8
# The flaw is that STDIN taken is the hostname your are login from
# not necessarilly your WorkStation (bouncing from another dev server)
# --------------------------------------------------------------------
FROMBOX=`who -mu | sed 's/[()]//g' | awk '{print $8}'` # Associated user (STDIN)
DISPLAY=`echo $FROMBOX | cut -d. -f 1` # FROMBOX is shortened after the first . encountered
ALPHNUM=`echo $DISPLAY | sed -e 's/[^[:alpha:]]//g'` # If DISPLAY is an IP address, a null value is stored in ALPHNUM
# DISPLAY var is set according to the value of ALPHNUM
# ----------------------------------------------------
if [ "$ALPHNUM" ]
then
export DISPLAY=$DISPLAY:0.0 # STDIN is a name
else
export DISPLAY=$FROMBOX:0.0 # STDIN is an IP address
fi
fi
# Some global variables setting
# -----------------------------
if [ "$TERM" = "" ]
then
export TERM=xterm
fi
# PROMPT setting
# --------------
export PS1="%n@%m:%~) "
export RPS1="%t"
# Miscellaneous
# -------------
export DIRSTACKSIZE=50 # Keep the directory stack from getting too large
export HISTSIZE=500 # Keep the history stack from getting too large
export HISTFILE=$HOME/.histfile
export SAVEHIST=$HISTSIZE
# Built a user directory in /gctmp if not existing
# USERNAME replaced by LOGNAME - DCC 17/12/2k8
# $LOGNAME should be more secure in use due to long/short login name uncertain working
# ------------------------------------------------------------------------------------
if [ -d /gctmp ]
then
if [ ! -d /gctmp/$LOGNAME ]
then
mkdir /gctmp/$LOGNAME
chmod 755 /gctmp/$LOGNAME
fi
export TMPDIR=/gctmp/$LOGNAME
fi
# Default user editor
# -------------------
export FCEDIT=vi
export EDITOR=vi
# Europe/Paris setting
# --------------------
if [ -r /etc/TIMEZONE ]
then
. /etc/TIMEZONE
else
TZ=MET
export TZ
fi
# Divers
#
umask 022
# Specific server OS Settings
# SLES10.... : Linux.2.6.16.46-0
# SLES9..... : Linux.2.6.5-7
# Solaris 10 : SunOs.5.10
# Solaris 8 : SunOs.5.8
# HP-UX..... : HP-UX.B.11.11
# --------------------------
fullSysName=`uname -r`;
stripSysName=${fullSysName%.[0-9]*-smp} # Keep 2.6.5-7 instead of 2.6.5-7.244-smp
if [ -f $REPENV/systems/zshenv.$(uname -s).$stripSysName ]
then
. $REPENV/systems/zshenv.$(uname -s).$stripSysName
fi
#JFR Source zshenv.Linux or zshenv.SunOS files
# --------------------------
stripSysName=`uname`;
if [ -f $REPENV/systems/zshenv.$stripSysName ]
then
. $REPENV/systems/zshenv.$stripSysName
fi
export TERMINFO=/usr/share/terminfo
# Specific HOST settings
# ----------------------
###################################
##NOT USED 26/02/2010
##INC990430
#
##Start JFR alias gmake make and scons for all gcolnx servers
#
#gcoserver=`echo $HOST | egrep 'ncegcolnx|ncegcocsd|ncegcochecks|ncegcoreg01'`
#
#if [ $gcoserver ]
#then
# . $REPENV/hosts/zshenv.gclinux
#fi
##End JFR alias gmake make and scons for all gco servers
#
##Start PDO alias gmake make and scons for all tsplnx servers
#
#tspserver=`echo $HOST | grep ncetsplnx`
#
#if [ $tspserver ]
#then
# . $REPENV/hosts/zshenv.tsplinux
#fi
##End PDO alias gmake make and scons for all tsp servers
###################################
if [ -f $REPENV/hosts/zshenv.$HOST ]
then
. $REPENV/hosts/zshenv.$HOST
fi
# Specific installed SOFTS settings (in local /softntools/softs linux folder)
# ---------------------------------------------------------------------------
for i in `/bin/ls -d /softs/*(N)|sed 's/.*\/\([^\/]*\)$/\1/'`
do
if [ -f $REPENV/softs/zshenv.$i ]
then
. $REPENV/softs/zshenv.$i
fi
done
#
# Variables d'environnement
#
ORACLE_BASE=/softs/oracle
export ORACLE_BASE
#ORACLE_HOME=/softs/oracle/9.2.0.4
#export ORACLE_HOME
#PATH=$ORACLE_HOME/bin:$PATH
#export PATH
#LD_LIBRARY_PATH=$ORACLE_HOME/lib
#export LD_LIBRARY_PATH
#TNS_ADMIN=${ORACLE_HOME}/network/admin
#export TNS_ADMIN
# Specific installed TOOLS settings (in local /softntools/tools linux folder)
# ---------------------------------------------------------------------------
for i in `/bin/ls -d /tools/*(N)|sed 's/.*\/\([^\/]*\)$/\1/'`
do
if [ -f $REPENV/tools/zshenv.$i ]
then
. $REPENV/tools/zshenv.$i
fi
done
#
# Variables d'environnement
#
# Add to the PATH
export PATH=${PATH}:/tools/fileutils/bin
export MANPATH=${MANPATH}:/tools/fileutils/man
#
# Divers
#
# Specific optional tools settings (in local /softntools/opt folder) JFR 091116
# ---------------------------------------------------------------------
for i in `/bin/ls -d /opt/*(N) /opt/devsup/*(N) |sed 's/.*\/\([^\/]*\)$/\1/'`
do
if [ -f $REPENV/opt/zshenv.$i ]
then
. $REPENV/opt/zshenv.$i
fi
done
#
# Variables d'environnement
#
if [ -d /opt/devsup/bms/latest ];then
export PATH=/opt/devsup/bms/latest:$PATH
elif [ -d /remote/tools/Linux/GCO-TSP/OPT-TOOLS/localdevsuptool.noarch/devsup/bms/latest ];then
export PATH=/remote/tools/Linux/GCO-TSP/OPT-TOOLS/localdevsuptool.noarch/devsup/bms/latest:$PATH
fi
#
# Variables d'environnement
#
if [ -d /opt/devsup/cmk/latest ];then
export PATH=/opt/devsup/cmk/latest:/opt/devsup/dsm/latest:$PATH
elif [ -d /remote/tools/Linux/GCO-TSP/OPT-TOOLS/localdevsuptool.noarch/devsup/cmk/latest ];then
export PATH=/remote/tools/Linux/GCO-TSP/OPT-TOOLS/localdevsuptool.noarch/devsup/cmk/latest:/remote/tools/Linux/GCO-TSP/OPT-TOOLS/localdevsuptool.noarch/devsup/dsm/latest:$PATH
else
echo "dsp tools are not available on this machine"
fi
#
# Variables d'environnement
#
export PATH=/opt/devsup/ctm:$PATH
#
# Divers
#
#
# Variables d'environnement
#
if [ -f "/opt/python-2.6-64/bin/python" ]; then
export MERCURIAL_VERSION=2.2.3
else
export MERCURIAL_VERSION=1.6.4
fi
export MERCURIAL_BASE=/opt/devsup/mercurial
export MERCURIAL_PYTHONPATH=${MERCURIAL_BASE}/mercurial-${MERCURIAL_VERSION}/lib/python2.6/site-packages
export PATH=${MERCURIAL_BASE}/bin:${PATH}
if [ -z $PYTHONPATH ] ; then
export PYTHONPATH=${MERCURIAL_PYTHONPATH}
else
export PYTHONPATH=${PYTHONPATH}:${MERCURIAL_PYTHONPATH}
fi
#
# Divers
#
#
# Variables d'environnement
#
if [ -z $PLATINUM_CLIENT_HOME ] ; then
if [ -d /opt/devsup/platinum ] ; then
export PLATINUM_CLIENT_HOME=/opt/devsup/platinum
elif [ -d /remote/devsup/latest/platinum/commandline ] ; then
export PLATINUM_CLIENT_HOME=/remote/devsup/latest/platinum/commandline
else
echo "Sorry, cannot find any valid location to set PLATINUM_CLIENT_HOME !"
exit 1
fi
fi
if [[ "$PYTHONPATH" != *"$PLATINUM_CLIENT_HOME"* ]]; then
export PYTHONPATH=$PYTHONPATH:$PLATINUM_CLIENT_HOME:$PLATINUM_CLIENT_HOME/tools
fi
#
# Divers
#
#
# Variables d'environnement
#
if [ -z $POLONIUM_HOME ] ; then
if [ -d /opt/devsup/polonium ] ; then
export POLONIUM_HOME=/opt/devsup/polonium
elif [ -d /remote/devsup/latest/polonium ] ; then
export POLONIUM_HOME=/remote/devsup/latest/polonium
else
echo "Sorry, cannot find any valid location to set POLONIUM_HOME !"
exit 1
fi
fi
#
# Variables d'environnement
#
export PATH=/opt/gcc/bin:$PATH
export MANPATH=/opt/gcc/man:$MANPATH
#
# Divers
#
#
# Variables d'environnement
#
export PATH=/opt/python-2.6-64/bin:$PATH
export MANPATH=/opt/python-2.6-64/man:$MANPATH
export PYTHONHOME=/opt/python-2.6-64
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/opt/python-2.6-64/lib
#
# Divers
#
# Specific NASTOOLS settings (in global /remote/tools/Linux/2.6 folder)
# ---------------------------------------------------------------------
for i in `/bin/ls -d /nastools/*(N)|sed 's/.*\/\([^\/]*\)$/\1/'`
do
if [ -f $REPENV/nastools/zshenv.$i ]
then
. $REPENV/nastools/zshenv.$i
fi
done
#
# Variables d'environnement
#
export PATH=$PATH:/nastools/ccache/bin
#
# Divers
#
#
# Variables d'environnement
#
export PATH=$PATH:/nastools/clewn/bin
#
# Divers
#
#
# Variables d'environnement
#
export PATH=$PATH:/nastools/cscope/bin
#
# Divers
#
#
# Variables d'environnement
#
export PATH=$PATH:/nastools/ctags/bin
#
# Divers
#
#
# Variables d'environnement
#
CURL_PATH='/nastools/curl'
if [ -e $CURL_PATH ]; then
export LD_LIBRARY_PATH=$CURL_PATH/lib:$LD_LIBRARY_PATH
export PATH=$CURL_PATH/bin:$PATH
fi;
#
# Divers
#
#
# Variables d'environnement
#
export PATH=$PATH:/nastools/ddd/bin
#
# Divers
#
#
# Variables d'environnement
#
export PATH=$PATH:/nastools/doxygen/bin
#
# Divers
#
#
# Variables d'environnement
#
export PATH=$PATH:/nastools/fuse/bin
#export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/nastools/fuse/lib
export LD_RUN_PATH=$LD_RUN_PATH:/nastools/fuse/lib
#
# Divers
#
#
# Variables d'environnement
#
export PATH=/nastools/gdb/bin:${PATH}
#
# Divers
#
#
# Variables d'environnement
#
#GITPATHVER='/nastools/git-1.8.4.3/bin'
GITPATH='/nastools/git'
GITMANPATH="$GITPATH/share/man"
GITBINPATH="$GITPATH/bin"
#if [ -e ${GITPATHVER} ]; then
# export PATH=$PATH:${GITPATHVER}
#fi;
if [ -e $GITPATH ]; then
export PATH=$PATH:$GITBINPATH
export MANPATH=$MANPATH:$GITMANPATH
fi;
#
# Divers
#
#
# Variables d'environnement
#
export PATH=$PATH:/nastools/gqlplus/bin
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/nastools/gqlplus/lib
#
# Divers
#
#
# Variables d'environnement
#
# Add to the PATH only if it exists on the machine
export PATH=$PATH:/nastools/graphviz/bin
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/nastools/graphviz/lib/graphviz
#
# Divers
#
#
# Variables d'environnement
#
export PATH=/nastools/java/bin:$PATH
#
# Divers
#
if [ -f /etc/SuSE-release ]; then
SUSE_VERSION=`grep VERSION /etc/SuSE-release | gawk '{print $3}'`
if [ $SUSE_VERSION = "9" ]; then
NASTOOL_PATH="/nastools"
elif [ $SUSE_VERSION = "10" ]; then
NASTOOL_PATH="/nastools/sles10"
elif [ $SUSE_VERSION = "11" ]; then
NASTOOL_PATH="/nastools/sles11"
fi
export PATH=$PATH:$NASTOOL_PATH/kcachegrind/bin
export KDEDIR=$NASTOOL_PATH/kcachegrind
fi
export PATH=$PATH:/nastools/lcov/bin
#
# Variables d'environnement
#
export MANPATH=/nastools/man:$MANPATH
#
# Divers
#
#
# Variables d'environnement
#
export PATH=$PATH:/nastools/ncftp/bin
#
# Divers
#
#
# Variables d'environnement
#
export PATH=$PATH:/nastools/nfswatch/bin
#
# Divers
#
#
# Variables d'environnement
#
OPENSSL_PATH='/nastools/openssl'
if [ -e $OPENSSL_PATH ]; then
export LD_LIBRARY_PATH=$OPENSSL_PATH/lib:$LD_LIBRARY_PATH
export PATH=$OPENSSL_PATH/bin:$PATH
fi;
#
# Divers
#
if [ -f /etc/SuSE-release ]; then
SUSE_VERSION=`grep VERSION /etc/SuSE-release | gawk '{print $3}'`
if [ "$SUSE_VERSION" = "9" ]; then
NASTOOL_PATH="/nastools"
elif [ "$SUSE_VERSION" = "10" ]; then
NASTOOL_PATH="/nastools/sles10"
elif [ "$SUSE_VERSION" = "11" ]; then
NASTOOL_PATH="/nastools/sles11"
fi
export PATH=$PATH:$NASTOOL_PATH/valgrind/bin
export MANPATH=$MANPATH:$NASTOOL_PATH/valgrind/man
export LD_RUN_PATH=$LD_RUN_PATH:$NASTOOL_PATH/valgrind/lib
fi
#
# Variables d'environnement
#
export PATH=$PATH:/nastools/valgui/bin
#
# Divers
#
export PATH=$PATH:/nastools/valkyrie/bin
#
# Variables d'environnement
#
export PATH=$PATH:/nastools/vim/bin
#
# Divers
#
# Specific USER GROUPS settings (according to user primary group membership)
# --------------------------------------------------------------------------
for i in $(groups $USERNAME)
do
if [ -f $REPENV/teams/zshenv.$i ]
then
. $REPENV/teams/zshenv.$i
fi
done
# Specific PROJECT GROUPS settings (according to user secondary group membership)
# -------------------------------------------------------------------------------
for i in $(groups $USERNAME)
do
if [ -f $REPENV/projects/zshenv.$i ]
then
. $REPENV/projects/zshenv.$i
fi
done
#==============================
# SBR Server .zshenv
#------------------------------
### Path (Asked by VAS)
export PATH=$PATH:/remote/projteams/projects/dbl_pnr_/bin
### Oracle
. /nastools/oracle/util/init_env res > /dev/null
cd /nastools/oracle/util
. ./setenv $*
#!/bin/sh
#
# Set environment variables for the database specified in parameter
#
###############################################
#
if [[ "X$1" = "X" ]]
then
echo "ERROR: this script takes one parameter: the database name or Oracle release"
return 1
fi
FORCE_MODE=0
APPEND_MODE=0
if [[ "X$2" != "X" && "$2" != "-f" && "$2" != "-a" ]]
then
echo "ERROR: second paramater of this script, if used, can be '-f' or '-a' only"
return 1
elif [[ "$2" = "-f" ]]
then
FORCE_MODE=1
elif [[ "$2" = "-a" ]]
then
APPEND_MODE=1
fi
if [[ "X$3" != "X" && "$3" != "-f" && "$3" != "-a" ]]
then
echo "ERROR: third paramater of this script, if used, can be '-f' or '-a' only"
return 1
elif [[ "$3" = "-f" ]]
then
FORCE_MODE=1
elif [[ "$3" = "-a" ]]
then
APPEND_MODE=1
fi
## unalias ls >/dev/null 2>&1
json=1
# Check if the first paramter was actually JSON format
if [[ $1 == \{* ]]
then
json=0
oracle_release=`echo $1 | grep -Po 'oracle-release=\K[^,}]*'`
server=`echo $1 | grep -Po 'server=\K[^,}]*'`
ORACLE_SID=`echo $1 | grep -Po 'oracle-sid=\K[^,}]*'`
DB_NAME=`echo $1 | grep -Po 'name=\K[^,}]*'`
ORACLE_ROOT_OVERRIDE=`echo $1 | grep -Po 'oracle-root-override=\K[^,}]*'`
TNS_ADMIN_OVERRIDE=`echo $1 | grep -Po 'tns-admin-override=\K[^,}]*'`
if [ -z "$ORACLE_SID" ]
then
ORACLE_SID=$DB_NAME
fi
else
DB_NAME=$(echo $1 | awk '{print toupper($0)}')
fi
if [ -z "$TNS_ADMIN" ]
then
TNS_ADMIN=/nastools/oracle/etc
fi
DB_COMMENT=$(echo $2 | awk '{print toupper($0)}')
DEFAULT_ORACLE_ROOT=/nastools/oracle/products
ORACLE_ROOT=${DEFAULT_ORACLE_ROOT}
# Check if the first parameter was actually an Oracle Release
for release in 9.2.0.7 9.2.0.8 10.2.0.2 10.2.0.3 10.2.0.4 11.1.0.6.0 11.1.0.7 11.2.0.1 11.2.0.2 11.2.0.3 11.2.0.4 11.2.0.4.4 12.1.0.2 12.2.0.1
do
if [ ${DB_NAME} = ${release} ]
then
if [ -d ${ORACLE_ROOT}/${release} ]
then
ORACLE_HOME=${ORACLE_ROOT}/${release}
if [ -d ${ORACLE_ROOT}/${release}cl ]; then
ORACLE_HOME=${ORACLE_ROOT}/${release}cl
fi
echo "Exporting DISABLE_HUGETLBFS=1 ..."
export DISABLE_HUGETLBFS=1
echo "Exporting ORACLE_HOME=${ORACLE_HOME} ..."
export ORACLE_HOME=${ORACLE_HOME}
if [[ ${APPEND_MODE} = 1 ]]
then
echo "Exporting PATH=\${PATH}:${ORACLE_HOME}/bin"
export PATH=${PATH}:${ORACLE_HOME}/bin
else
echo "Exporting PATH=${ORACLE_HOME}/bin:\${PATH} ..."
export PATH=${ORACLE_HOME}/bin:${PATH}
fi
if [[ ${APPEND_MODE} = 1 ]]
then
echo "Exporting LD_LIBRARY_PATH=\${LD_LIBRARY_PATH}:${ORACLE_HOME}/lib"
export LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:${ORACLE_HOME}/lib
else
echo "Exporting LD_LIBRARY_PATH=${ORACLE_HOME}/lib:\${LD_LIBRARY_PATH} ..."
export LD_LIBRARY_PATH=${ORACLE_HOME}/lib:${LD_LIBRARY_PATH}
fi
echo "Exporting TNS_ADMIN=${TNS_ADMIN} ..."
export TNS_ADMIN=${TNS_ADMIN}
return 0
else
echo "ERROR: directory ${ORACLE_ROOT}/${release} does not exist !"
return 1
fi
fi
done
# Check if the first parameter was actually mysql
if [ ${DB_NAME} = "MYSQL" ]
then
echo "Exporting PATH=/projects/dsdeldev/SQL_MySQL/5-1-22/Linux2-6_64/bin:\$PATH ..."
export PATH=/projects/dsdeldev/SQL_MySQL/5-1-22/Linux2-6_64/bin:$PATH
echo "Please set CONNECT_STRING to something like \"-u root -pgcguest -h ncegcolnx44\""
alias sql='eval mysql $CONNECT_STRING'
echo "Then you can use \"sql\" alias to connect: sql='eval mysql \$CONNECT_STRING' !!!"
return 0
fi
ORA_BASE=/nastools/oracle
TOPOLOGY_FILE=${ORA_BASE}/etc/db_topology.xml
unset PYTHONHOME
OS=$(uname -s)
PYTHONBIN=${ORA_BASE}/python/${OS}/bin/python
# If no JSON, get database informations from db_topology.xml
if [[ $json -ne 0 ]]
then
db_info=$(export PYTHONPATH=${ORA_BASE}/lib/python; export LD_LIBRARY_PATH=${ORA_BASE}/lib/python:/nastools/python-2.4-64/lib:${LD_LIBRARY_PATH}; ${PYTHONBIN} ${ORA_BASE}/util/readDbTopologyXml.py -f ${TOPOLOGY_FILE} -d ${DB_NAME})
if [[ $? -ne 0 ]]
then
return 1
fi
oracle_release=$(echo $db_info | cut -d '|' -f1)
server=$(echo $db_info | cut -d '|' -f3)
ORACLE_SID=$(echo $db_info | cut -d '|' -f5)
ORACLE_ROOT_OVERRIDE=$(echo $db_info | cut -d '|' -f9)
TNS_ADMIN_OVERRIDE=$(echo $db_info | cut -d '|' -f13)
DB_NAME=$(echo $db_info | cut -d '|' -f15)
fi
if [[ $(hostname) = ${server} ]]; then
ORACLE_ROOT=/softs/oracle
fi
if [ -n "${ORACLE_ROOT_OVERRIDE}" ]
then
ORACLE_ROOT=${ORACLE_ROOT_OVERRIDE}
fi
if [ -n "${TNS_ADMIN_OVERRIDE}" ]
then
TNS_ADMIN=${TNS_ADMIN_OVERRIDE}
fi
ORACLE_HOME=${ORACLE_ROOT}/${oracle_release}
if [[ ! -d ${ORACLE_HOME} ]]
then
echo "INFO : Oracle release is ${oracle_release} but directory ${ORACLE_ROOT}/${oracle_release} does not exist"
if [[ $(hostname) = ${server} ]]
then
echo "ERROR: we are on the same server as the database => the only possible value for ORACLE_HOME was ${ORACLE_ROOT}/${oracle_release} !"
return 1
else
# we first see if this version is on default oracle root
ORACLE_HOME=${DEFAULT_ORACLE_ROOT}/${oracle_release}
if [[ -d ${ORACLE_HOME} ]]
then
echo "INFO : Oracle release ${oracle_release} found in default oracle root"
else
# We get the major number of the Oracle release
oracle_release_major_number=$(echo ${oracle_release} | cut -d '.' -f1)
# Then we take same biggest existing Oracle release with same major number
# for instance if major number is 9, and we have the choice between 9.2.0.7 and 9.2.0.8
# we take 9.2.0.8.
ORACLE_HOME=$(\ls -dr ${DEFAULT_ORACLE_ROOT}/${oracle_release_major_number}.* | head -1)
fi
fi
fi
if [[ ! -d "${ORACLE_HOME}" ]]
then
echo "ERROR: environment variable ORACLE_HOME could not be set !"
return 1
fi
echo "Exporting DISABLE_HUGETLBFS=1 ..."
export DISABLE_HUGETLBFS=1
echo "Exporting ORACLE_SID=${ORACLE_SID} ..."
export ORACLE_SID=${ORACLE_SID}
echo "Exporting ORACLE_HOME=${ORACLE_HOME} ..."
export ORACLE_HOME=${ORACLE_HOME}
if [[ ${APPEND_MODE} = 1 ]]
then
echo "Exporting PATH=\${PATH}:${ORACLE_HOME}/bin"
export PATH=${PATH}:${ORACLE_HOME}/bin
else
echo "Exporting PATH=${ORACLE_HOME}/bin:\${PATH} ..."
export PATH=${ORACLE_HOME}/bin:${PATH}
fi
if [[ ${APPEND_MODE} = 1 ]]
then
echo "Exporting LD_LIBRARY_PATH=\${LD_LIBRARY_PATH}:${ORACLE_HOME}/lib"
export LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:${ORACLE_HOME}/lib
else
echo "Exporting LD_LIBRARY_PATH=${ORACLE_HOME}/lib:\${LD_LIBRARY_PATH} ..."
export LD_LIBRARY_PATH=${ORACLE_HOME}/lib:${LD_LIBRARY_PATH}
fi
echo "Exporting TNS_ADMIN=${TNS_ADMIN} ..."
export TNS_ADMIN=${TNS_ADMIN}
if [[ $(hostname) != ${server} || "${FORCE_MODE}" = "1" ]]
then
echo "The server is running on ${server}"
echo "Exporting TWO_TASK=${DB_NAME}ls ..."
export TWO_TASK=${DB_NAME}ls
else
echo "Unsetting TWO_TASK ..."
unset TWO_TASK
echo "Creating alias sys=\"sqlplus '/as sysdba'\" and gsys=\"gqlplus -d '/as sysdba'\" ..."
alias sys="sqlplus '/as sysdba'"
alias gsys="gqlplus -d '/as sysdba'"
echo "To connect as sysdba to ${DB_NAME} just type 'sys' !!!"
fi
return 0
cd - >/dev/null
export TNS_ADMIN=/nastools/oracle/etc
export ORACLE_VERSION=10.2.0.3
export ORACLE_HOME=/softs/oracle/$ORACLE_VERSION
export PATH=$ORACLE_HOME/bin:$PATH
export LD_LIBRARY_PATH=$ORACLE_HOME/lib:/nastools/oracle/products/$ORACLE_VERSION/lib:$LD_LIBRARY_PATH
export LANG=en_US.UTF-8
export NLS_LANG=AMERICAN_AMERICA.UTF8
### Use vim as default editor
export EDITOR='vim'
# Specific USER home environment settings
# ---------------------------------------
#if [ -f ~/.zshenv.$LOGNAME ]
#then
# . ~/.zshenv.$LOGNAME
#fi
if [ -f ~/.zshenv.user ]
then
. ~/.zshenv.user
fi
#EOF
#
unset file
# read bash.bashrc first for some features we dont want
# to re-implement here
#source /etc/bash.bashrc
# zsh line editing
: ${ZSHEDIT:="emacs"}
: ${TERM:=linux}
if [[ "$ZSHEDIT" == "vi" ]] then
bindkey -v
else
bindkey -e
bindkey "^[ " magic-space
bindkey "^[!" expand-history
fi
# Environment
HISTSIZE=1000
HISTFILE=${HOME}/.zsh_history
SAVEHIST=500
# Prompt on the right side. zsh feature
#RPROMPT="[%T]"
# Set/unset shell options
setopt globdots nocorrect pushdtohome autolist nopromptcr
setopt nocorrectall autocd recexact longlistjobs
setopt histignoredups pushdsilent appendhistory histexpiredupsfirst
setopt autopushd pushdminus extendedglob rcquotes
unsetopt bgnice autoparamslash hup
# Setup some basic programmable completions. To see more examples
# of these, check out /usr/doc/packages/zsh/compctl-examples.
# You you have a slow machine, you might want to comment the lines below
# with compctl in, and comment the below two lines out.
#
# compctl -g '*(-/)' cd pushd
# compctl -g '*(/)' rmdir dircmp
# compctl -j -P % -x 's[-] p[1]' -k signals -- kill
# compctl -j -P % fg bg wait jobs disown
# compctl -A shift
# compctl -caF type whence which
# compctl -F unfunction
# compctl -a unalias
# compctl -v unset typeset declare vared readonly export integer
# compctl -e disable
# compctl -d enable
#
# The default way is the usage of the zsh built-in completer
# Comment the two below lines out, if you are on a slow machine, and
# comment the above compctl lines in.
autoload -U compinit
compinit
#files: 565 version: 4.3.6
_comps=(
'-' '_precommand'
'.' '_source'
'a2dismod' '_a2utils'
'a2dissite' '_a2utils'
'a2enmod' '_a2utils'
'a2ensite' '_a2utils'
'a2ps' '_a2ps'
'aaaa' '_hosts'
'aap' '_aap'
'acpi' '_acpi'
'acpitool' '_acpitool'
'acroread' '_acroread'
'admin' '_sccs'
'ali' '_mh'
'alias' '_alias'
'amaya' '_webbrowser'
'analyseplugin' '_analyseplugin'
'animate' '_imagemagick'
'anno' '_mh'
'ant' '_ant'
'antiword' '_antiword'
'apache2ctl' '_apachectl'
'apachectl' '_apachectl'
'apm' '_apm'
'appletviewer' '_java'
'apropos' '_man'
'apt-cache' '_apt'
'apt-cdrom' '_apt'
'apt-config' '_apt'
'apt-file' '_apt-file'
'apt-get' '_apt'
'aptitude' '_aptitude'
'apt-move' '_apt-move'
'apt-show-versions' '_apt-show-versions'
'arena' '_webbrowser'
'arp' '_arp'
'arping' '_arping'
'-array-value-' '_value'
'-assign-parameter-' '_assign'
'attr' '_attr'
'auto-apt' '_auto-apt'
'autoload' '_typeset'
'bash' '_sh'
'baz' '_baz'
'bg' '_jobs_bg'
'bindkey' '_bindkey'
'bison' '_bison'
'bogofilter' '_bogofilter'
'bogotune' '_bogofilter'
'bogoutil' '_bogofilter'
'-brace-parameter-' '_brace_parameter'
'brctl' '_brctl'
'btdownloadcurses' '_bittorrent'
'btdownloadgui' '_bittorrent'
'btdownloadheadless' '_bittorrent'
'btlaunchmany' '_bittorrent'
'btlaunchmanycurses' '_bittorrent'
'btmakemetafile' '_bittorrent'
'btreannounce' '_bittorrent'
'btrename' '_bittorrent'
'bts' '_bts'
'btshowmetainfo' '_bittorrent'
'bttrack' '_bittorrent'
'bug' '_bug'
'buildhash' '_ispell'
'builtin' '_builtin'
'bunzip2' '_bzip2'
'burst' '_mh'
'bzcat' '_bzip2'
'bzip2' '_bzip2'
'bzip2recover' '_bzip2'
'bzr' '_bzr'
'cal' '_cal'
'calendar' '_calendar'
'catchsegv' '_precommand'
'ccal' '_ccal'
'cd' '_cd'
'cdbs-edit-patch' '_cdbs-edit-patch'
'cdc' '_sccs'
'cdcd' '_cdcd'
'cdrdao' '_cdrdao'
'cdrecord' '_cdrecord'
'certtool' '_gnutls'
'cftp' '_twisted'
'chage' '_users'
'chdir' '_cd'
'chflags' '_chflags'
'chfn' '_users'
'chgrp' '_chown'
'chimera' '_webbrowser'
'chkconfig' '_chkconfig'
'chmod' '_chmod'
'chown' '_chown'
'chsh' '_users'
'ci' '_rcs'
'ckeygen' '_twisted'
'clear' '_nothing'
'co' '_rcs'
'comb' '_sccs'
'combine' '_imagemagick'
'comm' '_comm'
'command' '_command'
'-command-' '_autocd'
'-command-line-' '_normal'
'comp' '_mh'
'compdef' '_compdef'
'composite' '_imagemagick'
'compress' '_compress'
'conch' '_twisted'
'-condition-' '_condition'
'config.status' '_configure'
'configure' '_configure'
'convert' '_imagemagick'
'cowsay' '_cowsay'
'cowthink' '_cowsay'
'cp' '_cp'
'cpio' '_cpio'
'cplay' '_cplay'
'crsh' '_cssh'
'csh' '_sh'
'cssh' '_cssh'
'csup' '_csup'
'curl' '_urls'
'cut' '_cut'
'cvs' '_cvs'
'cvsup' '_cvsup'
'cygcheck' '_cygcheck'
'cygcheck.exe' '_cygcheck'
'cygpath' '_cygpath'
'cygpath.exe' '_cygpath'
'cygrunsrv' '_cygrunsrv'
'cygrunsrv.exe' '_cygrunsrv'
'cygserver' '_cygserver'
'cygserver.exe' '_cygserver'
'cygstart' '_cygstart'
'cygstart.exe' '_cygstart'
'dak' '_dak'
'darcs' '_darcs'
'date' '_date'
'dch' '_debchange'
'dchroot' '_dchroot'
'dchroot-dsa' '_dchroot-dsa'
'dcop' '_dcop'
'dcopclient' '_dcop'
'dcopfind' '_dcop'
'dcopobject' '_dcop'
'dcopref' '_dcop'
'dcopstart' '_dcop'
'dd' '_dd'
'debchange' '_debchange'
'debdiff' '_debdiff'
'debfoster' '_debfoster'
'debsign' '_debsign'
'declare' '_typeset'
'-default-' '_default'
'defaults' '_defaults'
'delta' '_sccs'
'df' '_directories'
'dhclient' '_dhclient'
'dhclient3' '_dhclient'
'dict' '_dict'
'diff' '_diff'
'diffstat' '_diffstat'
'dillo' '_webbrowser'
'dircmp' '_directories'
'dirs' '_dirs'
'disable' '_disable'
'disown' '_jobs_fg'
'display' '_imagemagick'
'dist' '_mh'
'dlocate' '_dlocate'
'dmake' '_make'
'dmidecode' '_dmidecode'
'domainname' '_yp'
'dosdel' '_floppy'
'dosread' '_floppy'
'dpatch-edit-patch' '_dpatch-edit-patch'
'dpkg' '_dpkg'
'dpkg-buildpackage' '_dpkg-buildpackage'
'dpkg-cross' '_dpkg-cross'
'dpkg-deb' '_dpkg'
'dpkg-query' '_dpkg'
'dpkg-reconfigure' '_dpkg'
'dpkg-repack' '_dpkg-repack'
'dpkg-source' '_dpkg_source'
'dput' '_dput'
'du' '_du'
'dumper' '_dumper'
'dumper.exe' '_dumper'
'dupload' '_dupload'
'dvibook' '_dvi'
'dviconcat' '_dvi'
'dvicopy' '_dvi'
'dvidvi' '_dvi'
'dvips' '_dvi'
'dviselect' '_dvi'
'dvitodvi' '_dvi'
'dvitype' '_dvi'
'ecasound' '_ecasound'
'echotc' '_echotc'
'echoti' '_echoti'
'egrep' '_grep'
'elinks' '_elinks'
'elm' '_elm'
'emulate' '_emulate'
'enable' '_enable'
'enscript' '_enscript'
'env' '_env'
'epsffit' '_psutils'
'-equal-' '_equal'
'eval' '_precommand'
'eview' '_vim'
'evim' '_vim'
'exec' '_precommand'
'exim' '_vim'
'explodepkg' '_pkgtool'
'export' '_typeset'
'express' '_webbrowser'
'extcheck' '_java'
'extractres' '_psutils'
'fakeroot' '_fakeroot'
'false' '_nothing'
'fc' '_fc'
'fetchmail' '_fetchmail'
'fg' '_jobs_fg'
'fgrep' '_grep'
'figlet' '_figlet'
'find' '_find'
'findaffix' '_ispell'
'finger' '_finger'
'fink' '_fink'
'firefox' '_mozilla'
'-first-' '_first'
'fixdlsrps' '_psutils'
'fixfmps' '_psutils'
'fixmacps' '_psutils'
'fixpsditps' '_psutils'
'fixpspps' '_psutils'
'fixscribeps' '_psutils'
'fixtpps' '_psutils'
'fixwfwps' '_psutils'
'fixwpps' '_psutils'
'fixwwps' '_psutils'
'flasher' '_flasher'
'flex' '_flex'
'flist' '_mh'
'flists' '_mh'
'float' '_typeset'
'fned' '_zed'
'folder' '_mh'
'folders' '_mh'
'fortune' '_fortune'
'forw' '_mh'
'fsh' '_fsh'
'ftp' '_hosts'
'functions' '_typeset'
'fuser' '_fuser'
'fusermount' '_fusermount'
'fwhois' '_whois'
'g++' '_gcc'
'galeon' '_webbrowser'
'gcc' '_gcc'
'gdb' '_gdb'
'gdiff' '_diff'
'genisoimage' '_genisoimage'
'get' '_sccs'
'getafm' '_psutils'
'getclip' '_getclip'
'getclip.exe' '_getclip'
'getconf' '_getconf'
'getent' '_getent'
'getfacl' '_getfacl'
'getfacl.exe' '_getfacl'
'getfattr' '_attr'
'getmail' '_getmail'
'getopts' '_vars'
'gex' '_vim'
'ggv' '_gnome-gv'
'ghostscript' '_gs'
'ghostview' '_pspdf'
'git' '_git'
'git-add' '_git'
'git-am' '_git'
'git-annotate' '_git'
'git-apply' '_git'
'git-applymbox' '_git'
'git-applypatch' '_git'
'git-archimport' '_git'
'git-archive' '_git'
'git-bisect' '_git'
'git-blame' '_git'
'git-branch' '_git'
'git-cat-file' '_git'
'git-check-attr' '_git'
'git-checkout' '_git'
'git-checkout-index' '_git'
'git-check-ref-format' '_git'
'git-cherry' '_git'
'git-cherry-pick' '_git'
'git-clean' '_git'
'git-clone' '_git'
'git-clone-pack' '_git'
'git-commit' '_git'
'git-commit-tree' '_git'
'git-config' '_git'
'git-convert-objects' '_git'
'git-count-objects' '_git'
'git-cvsexportcommit' '_git'
'git-cvsimport' '_git'
'git-cvsserver' '_git'
'git-daemon' '_git'
'git-describe' '_git'
'git-diff' '_git'
'git-diff-files' '_git'
'git-diff-index' '_git'
'git-diff-stages' '_git'
'git-diff-tree' '_git'
'git-fast-import' '_git'
'git-fetch' '_git'
'git-fetch-pack' '_git'
'git-fmt-merge-msg' '_git'
'git-for-each-ref' '_git'
'git-format-patch' '_git'
'git-fsck' '_git'
'git-gc' '_git'
'git-get-tar-commit-id' '_git'
'git-grep' '_git'
'git-hash-object' '_git'
'git-http-fetch' '_git'
'git-http-push' '_git'
'git-imap-send' '_git'
'git-index-pack' '_git'
'git-init' '_git'
'git-instaweb' '_git'
'git-local-fetch' '_git'
'git-log' '_git'
'git-lost-found' '_git'
'git-ls-files' '_git'
'git-ls-remote' '_git'
'git-ls-tree' '_git'
'git-mailinfo' '_git'
'git-mailsplit' '_git'
'git-merge' '_git'
'git-merge-base' '_git'
'git-merge-file' '_git'
'git-merge-index' '_git'
'git-merge-one-file' '_git'
'git-mergetool' '_git'
'git-merge-tree' '_git'
'git-mktag' '_git'
'git-mktree' '_git'
'git-mv' '_git'
'git-name-rev' '_git'
'git-octopus' '_git'
'git-pack-objects' '_git'
'git-pack-redundant' '_git'
'git-pack-refs' '_git'
'git-patch-id' '_git'
'git-peek-remote' '_git'
'git-prune' '_git'
'git-prune-packed' '_git'
'git-pull' '_git'
'git-push' '_git'
'git-quiltimport' '_git'
'git-read-tree' '_git'
'git-rebase' '_git'
'git-receive-pack' '_git'
'git-reflog' '_git'
'git-relink' '_git'
'git-remote' '_git'
'git-repack' '_git'
'git-request-pull' '_git'
'git-rerere' '_git'
'git-reset' '_git'
'git-revert' '_git'
'git-rev-list' '_git'
'git-rev-parse' '_git'
'git-rm' '_git'
'git-send-email' '_git'
'git-send-pack' '_git'
'git-shell' '_git'
'git-shortlog' '_git'
'git-show' '_git'
'git-show-branch' '_git'
'git-show-index' '_git'
'git-show-ref' '_git'
'git-sh-setup' '_git'
'git-ssh-fetch' '_git'
'git-ssh-upload' '_git'
'git-status' '_git'
'git-stripspace' '_git'
'git-svn' '_git'
'git-svnimport' '_git'
'git-symbolic-ref' '_git'
'git-tag' '_git'
'git-tar-tree' '_git'
'git-unpack-file' '_git'
'git-unpack-objects' '_git'
'git-update-index' '_git'
'git-update-ref' '_git'
'git-update-server-info' '_git'
'git-upload-archive' '_git'
'git-upload-pack' '_git'
'git-var' '_git'
'git-verify-pack' '_git'
'git-verify-tag' '_git'
'git-whatchanged' '_git'
'git-write-tree' '_git'
'global' '_global'
'gls' '_ls'
'gmake' '_make'
'gmplayer' '_mplayer'
'gnome-gv' '_gnome-gv'
'gnutls-cli' '_gnutls'
'gnutls-cli-debug' '_gnutls'
'gpg' '_gpg'
'gpgv' '_gpg'
'gphoto2' '_gphoto2'
'gprof' '_gprof'
'gqview' '_gqview'
'grail' '_webbrowser'
'grep' '_grep'
'groff' '_groff'
'groupadd' '_user_admin'
'groupdel' '_groups'
'groupmod' '_user_admin'
'groups' '_users'
'growisofs' '_growisofs'
'gs' '_gs'
'gsbj' '_pspdf'
'gsdj' '_pspdf'
'gsdj500' '_pspdf'
'gslj' '_pspdf'
'gslp' '_pspdf'
'gsnd' '_pspdf'
'gtar' '_tar'
'guilt' '_guilt'
'guilt-add' '_guilt'
'guilt-applied' '_guilt'
'guilt-delete' '_guilt'
'guilt-files' '_guilt'
'guilt-fold' '_guilt'
'guilt-fork' '_guilt'
'guilt-header' '_guilt'
'guilt-help' '_guilt'
'guilt-import' '_guilt'
'guilt-import-commit' '_guilt'
'guilt-init' '_guilt'
'guilt-new' '_guilt'
'guilt-next' '_guilt'
'guilt-patchbomb' '_guilt'
'guilt-pop' '_guilt'
'guilt-prev' '_guilt'
'guilt-push' '_guilt'
'guilt-rebase' '_guilt'
'guilt-refresh' '_guilt'
'guilt-rm' '_guilt'
'guilt-series' '_guilt'
'guilt-status' '_guilt'
'guilt-top' '_guilt'
'guilt-unapplied' '_guilt'
'gunzip' '_gzip'
'gut-runstatus' '_git'
'gv' '_gv'
'gview' '_vim'
'gvim' '_vim'
'gvimdiff' '_vim'
'gzcat' '_gzip'
'gzilla' '_webbrowser'
'gzip' '_gzip'
'hash' '_hash'
'hdiutil' '_hdiutil'
'help' '_sccs'
'hg' '_mercurial'
'history' '_fc'
'host' '_hosts'
'hotjava' '_webbrowser'
'hwinfo' '_hwinfo'
'iceweasel' '_mozilla'
'icombine' '_ispell'
'iconv' '_iconv'
'id' '_id'
'identify' '_imagemagick'
'ifconfig' '_ifconfig'
'ifdown' '_net_interfaces'
'ifup' '_net_interfaces'
'ijoin' '_ispell'
'import' '_imagemagick'
'inc' '_mh'
'includeres' '_psutils'
'info' '_texinfo'
'infocmp' '_terminals'
'insmod' '_modutils'
'install-info' '_texinfo'
'installpkg' '_pkgtool'
'integer' '_typeset'
'invoke-rc.d' '_invoke-rc.d'
'ip' '_ip'
'iptables' '_iptables'
'iptables-restore' '_iptables'
'iptables-save' '_iptables'
'irssi' '_irssi'
'ispell' '_ispell'
'iwconfig' '_iwconfig'
'jadetex' '_tex'
'jar' '_java'
'jarsigner' '_java'
'java' '_java'
'javac' '_java'
'javadoc' '_java'
'javah' '_java'
'javap' '_java'
'jdb' '_java'
'jobs' '_jobs_builtin'
'joe' '_joe'
'keytool' '_java'
'kfmclient' '_kfmclient'
'kill' '_kill'
'killall' '_killall'
'killall5' '_killall'
'kldload' '_kld'
'kldunload' '_kld'
'knock' '_knock'
'konqueror' '_webbrowser'
'kpdf' '_pdf'
'ksh' '_sh'
'kvno' '_kvno'
'last' '_last'
'lastb' '_last'
'latex' '_tex'
'ldd' '_ldd'
'less' '_less'
'let' '_math'
'lftp' '_ncftp'
'light' '_webbrowser'
'lighty-disable-mod' '_lighttpd'
'lighty-enable-mod' '_lighttpd'
'limit' '_limit'
'linda' '_linda'
'links' '_links'
'lintian' '_lintian'
'linux' '_uml'
'loadkeys' '_loadkeys'
'local' '_typeset'
'locate' '_locate'
'log' '_nothing'
'logname' '_nothing'
'look' '_look'
'lore' '_twisted'
'losetup' '_losetup'
'lp' '_lp'
'lpq' '_lp'
'lpr' '_lp'
'lprm' '_lp'
'ls' '_ls'
'lscfg' '_lscfg'
'lsdev' '_lsdev'
'lslv' '_lslv'
'lsmod' '_modutils'
'lsof' '_lsof'
'lspv' '_lspv'
'lsusb' '_lsusb'
'lsvg' '_lsvg'
'lynx' '_lynx'
'lzop' '_lzop'
'm-a' '_module-assistant'
'madison' '_madison'
'mail' '_mail'
'Mail' '_mail'
'mailx' '_mail'
'make' '_make'
'makeinfo' '_texinfo'
'make-kpkg' '_make-kpkg'
'makepkg' '_pkgtool'
'man' '_man'
'manhole' '_twisted'
'mark' '_mh'
'-math-' '_math'
'mattrib' '_mtools'
'mcd' '_mtools'
'mcopy' '_mtools'
'md5sum' '_md5sum'
'mdel' '_mtools'
'mdeltree' '_mtools'
'mdir' '_mtools'
'mdu' '_mtools'
'members' '_members'
'mencal' '_mencal'
'mere' '_mere'
'merge' '_rcs'
'mergechanges' '_mergechanges'
'metaflac' '_metaflac'
'mformat' '_mtools'
'mgv' '_pspdf'
'mhlist' '_mh'
'mhmail' '_mh'
'mhn' '_mh'
'mhparam' '_mh'
'mhpath' '_mh'
'mhshow' '_mh'
'mhstore' '_mh'
'mii-tool' '_mii-tool'
'mkdir' '_mkdir'
'mkisofs' '_growisofs'
'mkshortcut' '_mkshortcut'
'mkshortcut.exe' '_mkshortcut'
'mktap' '_twisted'
'mkzsh' '_mkzsh'
'mkzsh.exe' '_mkzsh'
'mlabel' '_mtools'
'mlocate' '_locate'
'mmd' '_mtools'
'mmm' '_webbrowser'
'mmount' '_mtools'
'mmove' '_mtools'
'modinfo' '_modutils'
'modprobe' '_modutils'
'module' '_module'
'module-assistant' '_module-assistant'
'mogrify' '_imagemagick'
'mondoarchive' '_mondo'
'montage' '_imagemagick'
'Mosaic' '_webbrowser'
'mount' '_mount'
'mozilla' '_mozilla'
'mozilla-firefox' '_mozilla'
'mozilla-xremote-client' '_mozilla'
'mpc' '_mpc'
'mplayer' '_mplayer'
'mrd' '_mtools'
'mread' '_mtools'
'mren' '_mtools'
'msgchk' '_mh'
'mt' '_mt'
'mtn' '_monotone'
'mtoolstest' '_mtools'
'mtr' '_mtr'
'mtype' '_mtools'
'munchlist' '_ispell'
'mush' '_mail'
'mutt' '_mutt'
'mx' '_hosts'
'mysql' '_mysql_utils'
'mysqladmin' '_mysql_utils'
'mysqldiff' '_mysqldiff'
'mysqldump' '_mysql_utils'
'mysqlimport' '_mysql_utils'
'mysqlshow' '_mysql_utils'
'nail' '_mail'
'native2ascii' '_java'
'nautilus' '_nautilus'
'nc' '_netcat'
'ncal' '_cal'
'ncftp' '_ncftp'
'ncl' '_nedit'
'nedit' '_nedit'
'nedit-nc' '_nedit'
'netcat' '_netcat'
'netrik' '_webbrowser'
'netscape' '_netscape'
'newgrp' '_groups'
'next' '_mh'
'nice' '_nice'
'nmap' '_nmap'
'nmblookup' '_samba'
'nocorrect' '_precommand'
'noglob' '_precommand'
'nohup' '_precommand'
'ns' '_hosts'
'nslookup' '_nslookup'
'ntalk' '_other_accounts'
'odme' '_object_classes'
'odmget' '_object_classes'
'odmshow' '_object_classes'
'ogg123' '_vorbis'
'oggdec' '_vorbis'
'oggenc' '_vorbis'
'ogginfo' '_vorbis'
'open' '_open'
'opera' '_webbrowser'
'p4' '_perforce'
'p4d' '_perforce'
'pack' '_pack'
'packf' '_mh'
'-parameter-' '_parameter'
'parsehdlist' '_urpmi'
'passwd' '_users'
'patch' '_patch'
'pax' '_pax'
'pcat' '_pack'
'pcred' '_pids'
'pdf2dsc' '_pdf'
'pdf2ps' '_pdf'
'pdffonts' '_pdf'
'pdfimages' '_pdf'
'pdfinfo' '_pdf'
'pdfjadetex' '_tex'
'pdflatex' '_tex'
'pdfopt' '_pdf'
'pdftopbm' '_pdf'
'pdftops' '_pdf'
'pdftotext' '_pdf'
'perl' '_perl'
'perldoc' '_perldoc'
'pfiles' '_pids'
'pflags' '_pids'
'phoenix' '_webbrowser'
'php' '_php'
'pick' '_mh'
'pine' '_pine'
'pinef' '_pine'
'ping' '_ping'
'piuparts' '_piuparts'
'pkg_add' '_bsd_pkg'
'pkg-config' '_pkg-config'
'pkg_create' '_bsd_pkg'
'pkg_delete' '_bsd_pkg'
'pkg_info' '_bsd_pkg'
'pkgtool' '_pkgtool'
'pldd' '_pids'
'pmake' '_make'
'pman' '_perl_modules'
'pmap' '_pids'
'pmcat' '_perl_modules'
'pmdesc' '_perl_modules'
'pmeth' '_perl_modules'
'pmexp' '_perl_modules'
'pmfunc' '_perl_modules'
'pmload' '_perl_modules'
'pmls' '_perl_modules'
'pmpath' '_perl_modules'
'pmvers' '_perl_modules'
'podgrep' '_perl_modules'
'podpath' '_perl_modules'
'podtoc' '_perl_modules'
'poff' '_pon'
'policytool' '_java'
'pon' '_pon'
'popd' '_directory_stack'
'portlint' '_portlint'
'portsnap' '_portsnap'
'postsuper' '_postfix'
'prcs' '_prcs'
'prev' '_mh'
'print' '_print'
'printenv' '_printenv'
'prompt' '_prompt'
'prs' '_sccs'
'prt' '_sccs'
'prun' '_pids'
'ps2ascii' '_pspdf'
'ps2epsi' '_ps'
'ps2pdf' '_ps'
'ps2pdf12' '_ps'
'ps2pdf13' '_ps'
'ps2pdf14' '_ps'
'ps2pdfwr' '_ps'
'ps2ps' '_ps'
'psbook' '_psutils'
'pscp' '_pscp'
'pscp.exe' '_pscp'
'psig' '_pids'
'psmerge' '_psutils'
'psmulti' '_ps'
'psnup' '_psutils'
'psresize' '_psutils'
'psselect' '_psutils'
'pstack' '_pids'
'pstoedit' '_pspdf'
'pstop' '_pids'
'pstops' '_psutils'
'pstotgif' '_pspdf'
'pswrap' '_ps'
'ptree' '_pids'
'pump' '_pump'
'pushd' '_cd'
'putclip' '_putclip'
'putclip.exe' '_putclip'
'pwait' '_pids'
'pwdx' '_pids'
'pyhtmlizer' '_twisted'
'python' '_python'
'qemu' '_qemu'
'qiv' '_qiv'
'qtplay' '_qtplay'
'querybts' '_bug'
'quilt' '_quilt'
'r' '_fc'
'raggle' '_raggle'
'rake' '_rake'
'ranlib' '_ranlib'
'rar' '_rar'
'rc' '_sh'
'rcp' '_rlogin'
'rcs' '_rcs'
'rcsdiff' '_rcs'
'read' '_read'
'readonly' '_typeset'
'-redirect-' '_redirect'
'-redirect-,<,bunzip2' '_bzip2'
'-redirect-,<,bzip2' '_bzip2'
'-redirect-,>,bzip2' '_bzip2'
'-redirect-,<,compress' '_compress'
'-redirect-,>,compress' '_compress'
'-redirect-,-default-,-default-' '_files'
'-redirect-,<,gunzip' '_gzip'
'-redirect-,<,gzip' '_gzip'
'-redirect-,>,gzip' '_gzip'
'-redirect-,<,uncompress' '_compress'
'refile' '_mh'
'rehash' '_hash'
'removepkg' '_pkgtool'
'remsh' '_rlogin'
'renice' '_renice'
'repl' '_mh'
'reportbug' '_bug'
'reprepro' '_reprepro'
'retawq' '_webbrowser'
'rgview' '_vim'
'rgvim' '_vim'
'ri' '_ri'
'rlogin' '_rlogin'
'rmadison' '_madison'
'rmdel' '_sccs'
'rmdir' '_directories'
'rmf' '_mh'
'rmic' '_java'
'rmid' '_java'
'rmiregistry' '_java'
'rmm' '_mh'
'rmmod' '_modutils'
'rpm' '_rpm'
'rrdtool' '_rrdtool'
'rsh' '_rlogin'
'rsync' '_rsync'
'rtin' '_tin'
'rubber' '_rubber'
'rubber-info' '_rubber'
'rubber-pipe' '_rubber'
'ruby' '_ruby'
'rup' '_hosts'
'rusage' '_precommand'
'rview' '_vim'
'rvim' '_vim'
'rwho' '_hosts'
'sabcmd' '_sablotron'
'sact' '_sccs'
'scan' '_mh'
'sccs' '_sccs'
'sccsdiff' '_sccs'
'sched' '_sched'
'schroot' '_schroot'
'scp' '_ssh'
'screen' '_screen'
'sed' '_sed'
'serialver' '_java'
'service' '_service'
'set' '_set'
'setfattr' '_attr'
'setopt' '_setopt'
'sftp' '_ssh'
'sh' '_sh'
'shift' '_arrays'
'show' '_mh'
'showchar' '_psutils'
'showmount' '_showmount'
'sisu' '_sisu'
'skipstone' '_webbrowser'
'slitex' '_tex'
'slocate' '_locate'
'slogin' '_ssh'
'slrn' '_slrn'
'smbclient' '_samba'
'smbcontrol' '_samba'
'smbstatus' '_samba'
'smit' '_smit'
'smitty' '_smit'
'soa' '_hosts'
'socket' '_socket'
'softwareupdate' '_softwareupdate'
'sortm' '_mh'
'source' '_source'
'spamassassin' '_spamassassin'
'sqsh' '_sqsh'
'sr' '_surfraw'
'srptool' '_gnutls'
'ssh' '_ssh'
'ssh-add' '_ssh'
'ssh-agent' '_ssh'
'sshfs' '_sshfs'
'ssh-keygen' '_ssh'
'star' '_tar'
'stat' '_stat'
'strip' '_strip'
'stty' '_stty'
'su' '_su'
'-subscript-' '_subscript'
'sudo' '_sudo'
'surfraw' '_surfraw'
'SuSEconfig' '_SuSEconfig'
'svn' '_subversion'
'svnadmin' '_subversion'
'svnadmin-static' '_subversion'
'svn-buildpackage' '_svn-buildpackage'
'sync' '_nothing'
'sysctl' '_sysctl'
'talk' '_other_accounts'
'tap2deb' '_twisted'
'tap2rpm' '_twisted'
'tapconvert' '_twisted'
'tar' '_tar'
'tardy' '_tardy'
'tcptraceroute' '_tcptraceroute'
'tcsh' '_sh'
'telnet' '_telnet'
'tex' '_tex'
'texi2dvi' '_texinfo'
'texindex' '_texinfo'
'tidy' '_tidy'
'-tilde-' '_tilde'
'time' '_precommand'
'times' '_nothing'
'tin' '_tin'
'tkconch' '_twisted'
'tkinfo' '_texinfo'
'tkmktap' '_twisted'
'tla' '_tla'
'todo.sh' '_todo.sh'
'toilet' '_toilet'
'totdconfig' '_totd'
'tpb' '_tpb'
'tpconfig' '_tpconfig'
'tpkg-debarch' '_toolchain-source'
'tpkg-install' '_toolchain-source'
'tpkg-install-libc' '_toolchain-source'
'tpkg-make' '_toolchain-source'
'tpkg-update' '_toolchain-source'
'tracepath' '_tracepath'
'tracepath6' '_tracepath'
'traceroute' '_hosts'
'trap' '_trap'
'trial' '_twisted'
'true' '_nothing'
'tryaffix' '_ispell'
'ttyctl' '_ttyctl'
'tunctl' '_uml'
'tune2fs' '_tune2fs'
'twistd' '_twisted'
'txt' '_hosts'
'type' '_which'
'typeset' '_typeset'
'ulimit' '_ulimit'
'uml_mconsole' '_uml'
'uml_moo' '_uml'
'uml_switch' '_uml'
'umount' '_mount'
'unace' '_unace'
'unalias' '_aliases'
'uname' '_uname'
'uncompress' '_compress'
'unexpand' '_unexpand'
'unfunction' '_functions'
'unget' '_sccs'
'unhash' '_unhash'
'uniq' '_uniq'
'units' '_units'
'unlimit' '_limits'
'unpack' '_pack'
'unrar' '_rar'
'unset' '_vars'
'unsetopt' '_unsetopt'
'unzip' '_zip'
'update-alternatives' '_update-alternatives'
'update-rc.d' '_update-rc.d'
'upgradepkg' '_pkgtool'
'urpme' '_urpmi'
'urpmf' '_urpmi'
'urpmi' '_urpmi'
'urpmi.addmedia' '_urpmi'
'urpmi.removemedia' '_urpmi'
'urpmi.update' '_urpmi'
'urpmq' '_urpmi'
'urxvt' '_urxvt'
'uscan' '_uscan'
'useradd' '_user_admin'
'userdel' '_users'
'usermod' '_user_admin'
'val' '_sccs'
'valgrind' '_valgrind'
'-value-' '_value'
'-value-,ANT_ARGS,-default-' '_ant'
'-value-,CFLAGS,-default-' '_gcc'
'-value-,CPPFLAGS,-default-' '_gcc'
'-value-,-default-,-default-' '_value'
'-value-,DISPLAY,-default-' '_x_display'
'-value-,GREP_OPTIONS,-default-' '_grep'
'-value-,GZIP,-default-' '_gzip'
'-value-,LANG,-default-' '_locales'
'-value-,LANGUAGE,-default-' '_locales'
'-value-,LD_DEBUG,-default-' '_ld_debug'
'-value-,LDFLAGS,-default-' '_gcc'
'-value-,LESSCHARSET,-default-' '_less'
'-value-,LESS,-default-' '_less'
'-value-,LPDEST,-default-' '_printers'
'-value-,P4CLIENT,-default-' '_perforce'
'-value-,P4MERGE,-default-' '_perforce'
'-value-,P4PORT,-default-' '_perforce'
'-value-,P4USER,-default-' '_perforce'
'-value-,PERLDOC,-default-' '_perldoc'
'-value-,PRINTER,-default-' '_printers'
'-value-,TERM,-default-' '_terminals'
'-value-,TERMINFO_DIRS,-default-' '_dir_list'
'-value-,TZ,-default-' '_time_zone'
'-value-,VALGRIND_OPTS,-default-' '_valgrind'
'-value-,WWW_HOME,-default-' '_urls'
'-value-,XML_CATALOG_FILES,-default-' '_xmlsoft'
'vared' '_vared'
'-vared-' '_in_vared'
'vim' '_vim'
'vim-addons' '_vim-addons'
'vimdiff' '_vim'
'vncserver' '_vnc'
'vncviewer' '_vnc'
'vorbiscomment' '_vorbiscomment'
'vserver' '_vserver'
'vux' '_vux'
'vuxctl' '_vux'
'w3m' '_w3m'
'wait' '_wait'
'wajig' '_wajig'
'wanna-build' '_wanna-build'
'websetroot' '_twisted'
'wget' '_wget'
'what' '_sccs'
'whatis' '_man'
'whence' '_which'
'where' '_which'
'whereis' '_whereis'
'which' '_which'
'whoami' '_nothing'
'whois' '_whois'
'whom' '_mh'
'wiggle' '_wiggle'
'wodim' '_cdrecord'
'write' '_users_on'
'www' '_webbrowser'
'xargs' '_xargs'
'xauth' '_xauth'
'xdpyinfo' '_x_utils'
'xdvi' '_xdvi'
'xelatex' '_tex'
'xetex' '_tex'
'xev' '_x_utils'
'xfd' '_x_utils'
'xfig' '_xfig'
'xfontsel' '_x_utils'
'xhost' '_x_utils'
'xkill' '_x_utils'
'xli' '_xloadimage'
'xloadimage' '_xloadimage'
'xmllint' '_xmlsoft'
'xmodmap' '_xmodmap'
'xmosaic' '_webbrowser'
'xon' '_x_utils'
'xpdf' '_xpdf'
'xping' '_hosts'
'xrandr' '_xrandr'
'xrdb' '_x_utils'
'xscreensaver-command' '_xscreensaver'
'xset' '_xset'
'xsetbg' '_xloadimage'
'xsetroot' '_x_utils'
'xsltproc' '_xmlsoft'
'xterm' '_xterm'
'xtightvncviewer' '_vnc'
'xtp' '_imagemagick'
'xv' '_xv'
'xview' '_xloadimage'
'xvnc4viewer' '_vnc'
'xvncviewer' '_vnc'
'xwd' '_x_utils'
'xwininfo' '_x_utils'
'xwit' '_xwit'
'xwud' '_x_utils'
'yast' '_yast'
'yast2' '_yast'
'ypbind' '_yp'
'ypcat' '_yp'
'ypmatch' '_yp'
'yppasswd' '_yp'
'yppoll' '_yp'
'yppush' '_yp'
'ypserv' '_yp'
'ypset' '_yp'
'ypwhich' '_yp'
'ypxfr' '_yp'
'ytalk' '_other_accounts'
'yum' '_yum'
'zcat' '_zcat'
'zcompile' '_zcompile'
'zcp' '_zmv'
'zdump' '_zdump'
'zed' '_zed'
'zen' '_webbrowser'
'zip' '_zip'
'zipinfo' '_zip'
'zle' '_zle'
'zln' '_zmv'
'zmail' '_mail'
'zmodload' '_zmodload'
'zmv' '_zmv'
'zone' '_hosts'
'zpty' '_zpty'
'zsh' '_sh'
'zstat' '_stat'
'zstyle' '_zstyle'
'zxpdf' '_xpdf'
)
_services=(
'bzcat' 'bunzip2'
'dch' 'debchange'
'gzcat' 'gunzip'
'iceweasel' 'firefox'
'Mail' 'mail'
'mailx' 'mail'
'nail' 'mail'
'ncl' 'nc'
'nedit-nc' 'nc'
'pcat' 'unpack'
'-redirect-,<,bunzip2' 'bunzip2'
'-redirect-,<,bzip2' 'bzip2'
'-redirect-,>,bzip2' 'bunzip2'
'-redirect-,<,compress' 'compress'
'-redirect-,>,compress' 'uncompress'
'-redirect-,<,gunzip' 'gunzip'
'-redirect-,<,gzip' 'gzip'
'-redirect-,>,gzip' 'gunzip'
'-redirect-,<,uncompress' 'uncompress'
'remsh' 'rsh'
'slogin' 'ssh'
'svnadmin-static' 'svnadmin'
'xelatex' 'latex'
'xetex' 'tex'
)
_patcomps=(
'*/(init|rc[0-9S]#).d/*' '_init_d'
'zf*' '_zftp'
)
_postpatcomps=(
'(p[bgpn]m*|*top[bgpn]m)' '_pbm'
'(texi(2*|ndex))' '_texi'
'(tiff*|*2tiff|pal2rgb)' '_tiff'
'-value-,(ftp|http(|s))_proxy,-default-' '_urls'
'-value-,LC_*,-default-' '_locales'
'-value-,*path,-default-' '_directories'
'-value-,*PATH,-default-' '_dir_list'
'-value-,RUBY(LIB|OPT|PATH),-default-' '_ruby'
'*/X11(|R[456])/*' '_x_arguments'
'yodl(|2*)' '_yodl'
)
_compautos=(
'_call_program' '+X'
)
zle -C _bash_complete-word .complete-word _bash_completions
zle -C _bash_list-choices .list-choices _bash_completions
zle -C _complete_debug .complete-word _complete_debug
zle -C _complete_help .complete-word _complete_help
zle -C _complete_tag .complete-word _complete_tag
zle -C _correct_filename .complete-word _correct_filename
zle -C _correct_word .complete-word _correct_word
zle -C _expand_alias .complete-word _expand_alias
zle -C _expand_word .complete-word _expand_word
zle -C _history-complete-newer .complete-word _history_complete_word
zle -C _history-complete-older .complete-word _history_complete_word
zle -C _list_expansions .list-choices _expand_word
zle -C _most_recent_file .complete-word _most_recent_file
zle -C _next_tags .list-choices _next_tags
zle -C _read_comp .complete-word _read_comp
bindkey '^X^R' _read_comp
bindkey '^X?' _complete_debug
bindkey '^XC' _correct_filename
bindkey '^Xa' _expand_alias
bindkey '^Xc' _correct_word
bindkey '^Xd' _list_expansions
bindkey '^Xe' _expand_word
bindkey '^Xh' _complete_help
bindkey '^Xm' _most_recent_file
bindkey '^Xn' _next_tags
bindkey '^Xt' _complete_tag
bindkey '^X~' _bash_list-choices
bindkey '^[,' _history-complete-newer
bindkey '^[/' _history-complete-older
bindkey '^[~' _bash_complete-word
autoload -Uz _a2ps _a2utils _aap _acpi _acpitool \
_acroread _alias _aliases _all_labels _all_matches \
_alternative _analyseplugin _ant _antiword _apachectl \
_apm _approximate _apt _apt-file _aptitude \
_apt-move _apt-show-versions _arch_archives _arch_namespace _arg_compile \
_arguments _arp _arping _arrays _assign \
_attr _auto-apt _autocd _bash_completions _baz \
_bind_addresses _bindkey _bison _bittorrent _bogofilter \
_brace_parameter _brctl _bsd_pkg _bts _bug \
_builtin _bzip2 _bzr _cache_invalid _cal \
_calendar _call_function _canonical_paths _ccal _cd \
_cdbs-edit-patch _cdcd _cdrdao _cdrecord _chflags \
_chkconfig _chmod _chown _combination _comm \
_command _command_names _compdef _complete _complete_debug \
_complete_help _complete_help_generic _complete_tag _compress _condition \
_configure _correct _correct_filename _correct_word _cowsay \
_cp _cpio _cplay _cssh _csup \
_ctags_tags _cut _cvs _cvsup _cygcheck \
_cygpath _cygrunsrv _cygserver _cygstart _dak \
_darcs _date _dchroot _dchroot-dsa _dcop \
_dd _debchange _debdiff _debfoster _deb_packages \
_debsign _default _defaults _delimiters _describe \
_description _dhclient _dict _dict_words _diff \
_diff_options _diffstat _directories _directory_stack _dir_list \
_dirs _disable _dispatch _dlocate _dmidecode \
_domains _dpatch-edit-patch _dpkg _dpkg-buildpackage _dpkg-cross \
_dpkg-repack _dpkg_source _dput _du _dumper \
_dupload _dvi _ecasound _echotc _echoti \
_elinks _elm _email_addresses _emulate _enable \
_enscript _env _equal _expand _expand_alias \
_expand_word _fakeroot _fc _fetchmail _figlet \
_file_descriptors _files _file_systems _find _finger \
_fink _first _flasher _flex _floppy \
_fortune _fsh _functions _fuse_arguments _fuser \
_fusermount _fuse_values _gcc _gdb _generic \
_genisoimage _getclip _getconf _getent _getfacl \
_getmail _git _global _global_tags _globqual_delims \
_globquals _gnome-gv _gnu_generic _gnutls _gpg \
_gphoto2 _gprof _gqview _grep _groff \
_groups _growisofs _gs _guard _guilt \
_gv _gzip _hash _hdiutil _history \
_history_complete_word _history_modifiers _hosts _hwinfo _iconv \
_id _ifconfig _ignored _imagemagick _init_d \
_in_vared _invoke-rc.d _ip _iptables _irssi \
_ispell _iwconfig _java _java_class _jobs \
_jobs_bg _jobs_builtin _jobs_fg _joe _kfmclient \
_kill _killall _kld _knock _kvno \
_last _ldd _ld_debug _less _lighttpd \
_limit _limits _linda _links _lintian \
_list _list_files _loadkeys _locales _locate \
_logical_volumes _look _losetup _lp _ls \
_lscfg _lsdev _lslv _lsof _lspv \
_lsusb _lsvg _lynx _lzop _mac_applications \
_mac_files_for_application _madison _mail _mailboxes _main_complete \
_make _make-kpkg _man _match _math \
_md5sum _members _mencal _menu _mercurial \
_mere _mergechanges _message _metaflac _mh \
_mii-tool _mime_types _mkdir _mkshortcut _mkzsh \
_module _module-assistant _modutils _mondo _monotone \
_most_recent_file _mount _mozilla _mpc _mplayer \
_mt _mtools _mtr _multi_parts _mutt \
_my_accounts _mysqldiff _mysql_utils _nautilus _ncftp \
_nedit _netcat _net_interfaces _netscape _newsgroups \
_next_label _next_tags _nice _nmap _normal \
_nothing _nslookup _object_classes _oldlist _open \
_options _options_set _options_unset _other_accounts _pack \
_parameter _parameters _patch _path_commands _path_files \
_pax _pbm _pdf _perforce _perl \
_perl_basepods _perldoc _perl_modules _php _physical_volumes \
_pick_variant _pids _pine _ping _piuparts \
_pkg-config _pkgtool _pon _portlint _ports \
_portsnap _postfix _prcs _precommand _prefix \
_print _printenv _printers _prompt _ps \
_pscp _pspdf _psutils _pump _putclip \
_python _qemu _qiv _qtplay _quilt \
_raggle _rake _ranlib _rar _rcs \
_read _read_comp _redirect _regex_arguments _regex_words \
_renice _reprepro _requested _retrieve_cache _retrieve_mac_apps \
_ri _rlogin _rpm _rrdtool _rsync \
_rubber _ruby _sablotron _samba _sccs \
_sched _schroot _screen _sed _sep_parts \
_service _services _set _set_command _setopt \
_setup _sh _showmount _signals _sisu \
_slrn _smit _socket _softwareupdate _source \
_spamassassin _sqsh _ssh _sshfs _stat \
_store_cache _strip _stty _su _sub_commands \
_subscript _subversion _sudo _suffix_alias_files _surfraw \
_SuSEconfig _svn-buildpackage _sysctl _tags _tar \
_tar_archive _tardy _tcptraceroute _telnet _terminals \
_tex _texi _texinfo _tidy _tiff \
_tilde _tilde_files _time_zone _tin _tla \
_todo.sh _toilet _toolchain-source _totd _tpb \
_tpconfig _tracepath _trap _ttyctl _tune2fs \
_twisted _typeset _ulimit _uml _unace \
_uname _unexpand _unhash _uniq _units \
_unsetopt _update-alternatives _update-rc.d _urls _urpmi \
_urxvt _uscan _user_admin _user_at_host _users \
_users_on _valgrind _value _values _vared \
_vars _vim _vim-addons _vnc _volume_groups \
_vorbis _vorbiscomment _vserver _vux _w3m \
_wait _wajig _wakeup_capable_devices _wanna-build _wanted \
_webbrowser _wget _whereis _which _whois \
_wiggle _xargs _x_arguments _xauth _x_borderwidth \
_x_color _x_colormapid _x_cursor _x_display _xdvi \
_x_extension _xfig _x_font _x_geometry _x_keysym \
_xloadimage _x_locale _xmlsoft _x_modifier _xmodmap \
_x_name _xpdf _xrandr _x_resource _xscreensaver \
_x_selection_timeout _xset _xt_arguments _xterm _x_title \
_xt_session_id _x_utils _xv _x_visual _x_window \
_xwit _yast _yast2 _yodl _yp \
_yum _zcat _zcompile _zdump _zed \
_zftp _zip _zle _zmodload _zmv \
_zpty _zstyle
autoload -Uz +X _call_program
typeset -gUa _comp_assocs
_comp_assocs=( '' )
# Completion so "cd ..<TAB>" -> "cd ../"
# zstyle ':completion:*' special-dirs ..
# Online help
unalias run-help 2>/dev/null || true
autoload run-help
# Don't use zsh builtin which
alias which >/dev/null && unalias which
# Common standard keypad and cursor
bindkey "^[[2~" yank
bindkey "^[[3~" delete-char
# History completion on pgup and pgdown
autoload -U history-search-end
zle -N history-beginning-search-backward-end history-search-end
zle -N history-beginning-search-forward-end history-search-end
bindkey "^[[5~" history-beginning-search-backward-end
bindkey "^[[6~" history-beginning-search-forward-end
if [[ "$TERM" == "xterm" ]] then
bindkey "^[2;5~" yank
bindkey "^[3;5~" delete-char
bindkey "^[5;5~" up-history
bindkey "^[6;5~" down-history
fi
bindkey "^[[C" forward-char
bindkey "^[[D" backward-char
bindkey "^[[A" up-history
bindkey "^[[B" down-history
# Avoid network problems
# ... \177 (ASCII-DEL) and \010 (ASCII-BS)
# do `backward-delete-char'
# Note: `delete-char' is maped to \033[3~
# Therefore xterm's responce on pressing
# key Delete or KP-Delete should be
# \033[3~ ... NOT \177
bindkey "^?" backward-delete-char
bindkey "^H" backward-delete-char
# Home and End
if [[ "$TERM" == "xterm" ]] then
# Normal keypad and cursor of xterm
bindkey "^[[1~" history-search-backward
bindkey "^[[4~" set-mark-command
bindkey "^[[H" beginning-of-line
bindkey "^[[F" end-of-line
# Home and End of application keypad and cursor of xterm
bindkey "^[OH" beginning-of-line
bindkey "^[OF" end-of-line
bindkey "^[O5H" beginning-of-line
bindkey "^[O5F" end-of-line
else
if [[ "$TERM" == "kvt" ]] then
bindkey "^[[1~" history-search-backward
bindkey "^[[4~" set-mark-command
bindkey "^[OH" beginning-of-line
bindkey "^[OF" end-of-line
else
# TERM=linux or console
bindkey "^[[1~" beginning-of-line
bindkey "^[[4~" end-of-line
fi
fi
# Application keypad and cursor of xterm
if [[ "$TERM" == "xterm" ]] then
bindkey "^[OD" backward-char
bindkey "^[OC" forward-char
bindkey "^[OA" up-history
bindkey "^[OB" down-history
# DEC keyboard KP_F1 - KP_F4
bindkey -s "^[OP" "^["
bindkey "^[OQ" undo
bindkey "^[OR" undefined-key
bindkey "^[OS" kill-line
fi
if [[ "$TERM" == "gnome" ]] then
# or gnome terminal F1 - F4
bindkey -s "^[OP" "^["
bindkey "^[OQ" undo
bindkey "^[OR" undefined-key
bindkey "^[OS" kill-line
fi
# Function keys F1 - F12
if [[ "$TERM" == "linux" ]] then
# On console the first five function keys
bindkey "^[[[A" undefined-key
bindkey "^[[[B" undefined-key
bindkey "^[[[C" undefined-key
bindkey "^[[[D" undefined-key
bindkey "^[[[E" undefined-key
else
# The first five standard function keys
bindkey "^[[11~" undefined-key
bindkey "^[[12~" undefined-key
bindkey "^[[13~" undefined-key
bindkey "^[[14~" undefined-key
bindkey "^[[15~" undefined-key
fi
bindkey "^[[17~" undefined-key
bindkey "^[[18~" undefined-key
bindkey "^[[19~" undefined-key
bindkey "^[[20~" undefined-key
bindkey "^[[21~" undefined-key
# Note: F11, F12 are identical with Shift_F1 and Shift_F2
bindkey "^[[23~" undefined-key
bindkey "^[[24~" undefined-key
# Shift Function keys F1 - F12
# identical with F11 - F22
#
# bindkey "^[[23~" undefined-key
# bindkey "^[[24~" undefined-key
bindkey "^[[25~" undefined-key
bindkey "^[[26~" undefined-key
# DEC keyboard: F15=^[[28~ is Help
bindkey "^[[28~" undefined-key
# DEC keyboard: F16=^[[29~ is Menu
bindkey "^[[29~" undefined-key
bindkey "^[[31~" undefined-key
bindkey "^[[32~" undefined-key
bindkey "^[[33~" undefined-key
bindkey "^[[34~" undefined-key
if [[ "$TERM" == "xterm" ]] then
# Not common
bindkey "^[[35~" undefined-key
bindkey "^[[36~" undefined-key
fi
if [[ "$TERM" == "xterm" ]] then
# Application keypad and cursor of xterm
# with NumLock ON
#
# Operators
bindkey -s "^[Oo" "/"
bindkey -s "^[Oj" "*"
bindkey -s "^[Om" "-"
bindkey -s "^[Ok" "+"
bindkey -s "^[Ol" ","
bindkey -s "^[OM" "\n"
bindkey -s "^[On" "."
# Numbers
bindkey -s "^[Op" "0"
bindkey -s "^[Oq" "1"
bindkey -s "^[Or" "2"
bindkey -s "^[Os" "3"
bindkey -s "^[Ot" "4"
bindkey -s "^[Ou" "5"
bindkey -s "^[Ov" "6"
bindkey -s "^[Ow" "7"
bindkey -s "^[Ox" "8"
bindkey -s "^[Oy" "9"
fi
# EMACS line editing
if [[ "$ZSHEDIT" == "emacs" ]] then
# ... xterm application cursor
if [[ "$TERM" == "xterm" ]] then
bindkey "^[^[OD" backward-word
bindkey "^[^[OC" forward-word
bindkey "^[^[OA" up-history
bindkey "^[^[OB" down-history
bindkey "^^[OD" backward-char
bindkey "^^[OC" forward-char
bindkey "^^[OA" up-history
bindkey "^^[OB" down-history
fi
# Standard cursor
bindkey "^[^[[D" backward-word
bindkey "^[^[[C" forward-word
bindkey "^[^[[A" up-history
bindkey "^[^[[B" down-history
bindkey "^^[[D" backward-char
bindkey "^^[[C" forward-char
bindkey "^^[[A" up-history
bindkey "^^[[B" down-history
fi
# DO NOT EDIT THIS FILE !!!
# All your personal configuration should be done in .zshrc.<loginname>
# If for any reason you wish to bypass the standard process, you can create a
# .zshrc.override to set a custom environment, but DSP will not provide support
# in such a case.
if [ -e $HOME/.zshrc.override ]
then
file="$HOME/.zshrc.override"
else
file="$REPENV/buildrc"
fi
if [ -f $file ]
then
if tty -s
then
. $file
else
. $file > /dev/null
fi
fi
# Common server OS Settings
#
if [ -f $REPENV/systems/zshrc.allsystems ]
then
. $REPENV/systems/zshrc.allsystems
fi
#
# Options de shell
#
setopt ignoreeof
setopt noclobber
setopt extendedglob
setopt numericglobsort
setopt autopushd pushdsilent pushdtohome
setopt histverify histignoredups appendhistory
setopt zle
setopt correct correctall
setopt completeinword automenu
setopt autolist listtypes
setopt rcexpandparam
#
# Alias
#
alias ll='ls -lL'
alias la='ls -lLa'
alias dirs='dirs -v'
alias h='fc -l -50 '
alias rmi='rm -i'
alias psall='ps -ef'
#alias psmy='ps -ef | grep "^[ ]*$LOGNAME "'
#JFR 100916
alias psmy='ps -fu $USER | sort | egrep -v "ps -fu|sort|grep"'
alias chown='chown -h'
alias chgrp='chgrp -h'
alias exit='. /tools/scripts/global_scripts/exitclean'
alias myquotacheck='quota'
alias myquotalist='quota -v'
alias -g PM='| more'
alias -g PG='| grep'
alias -g PGV='| grep -v'
#
# Fonctions
#
#
# Divers
#
stty intr '^C'
#stty erase ''
stty kill '^K'
bindkey -e
# Specific server OS Settings
if [ -f $REPENV/systems/zshrc.$(uname -s).$(uname -r) ]
then
. $REPENV/systems/zshrc.$(uname -s).$(uname -r)
fi
# Specific HOST settings
# ----------------------
if [ -f $REPENV/hosts/zshrc.$HOST ]
then
. $REPENV/hosts/zshrc.$HOST
fi
# Specific installed TOOLS settings (in local /softntools/tools linux folder)
# ---------------------------------------------------------------------------
for i in `ls -d /softs/*(N)|sed 's/.*\/\([^\/]*\)$/\1/'`
do
if [ -f $REPENV/softs/zshrc.$i ]
then
. $REPENV/softs/zshrc.$i
fi
done
#
# Options de shell
#
#
# Alias
#
alias 9iR2-4='. /nastools/oracle/util/init_env.sh 9.2.0.4; echo "Switch to Oracle 9.2.0.4"'
alias 9iR2-5='. /nastools/oracle/util/init_env.sh 9.2.0.5; echo "Switch to Oracle 9.2.0.5"'
alias 9iR2-6='. /nastools/oracle/util/init_env.sh 9.2.0.6; echo "Switch to Oracle 9.2.0.6"'
alias 9iR2-7='. /nastools/oracle/util/init_env.sh 9.2.0.7; echo "Switch to Oracle 9.2.0.7"'
alias 10g='. /nastools/oracle/util/init_env.sh 10.1.0; echo "Switch to Oracle 10.1.0"'
alias 10gR2='. /nastools/oracle/util/init_env.sh 10.2.0; echo "Switch to Oracle 10.2.0"'
alias 10gR22='. /nastools/oracle/util/init_env.sh 10.2.0.2; echo "Switch to Oracle 10.2.0.2"'
# Specific installed TOOLS settings (in local /softntools/tools linux folder)
# ---------------------------------------------------------------------------
for i in `ls -d /tools/*(N)|sed 's/.*\/\([^\/]*\)$/\1/'`
do
if [ -f $REPENV/tools/zshrc.$i ]
then
. $REPENV/tools/zshrc.$i
fi
done
#
# Options de shell
#
#
# Alias
#
[[ -x /tools/fileutils/bin/df ]] && alias df='/tools/fileutils/bin/df'
#
# Fonctions
#
#
# Divers
#
# Specific NASTOOLS settings (in global /remote/tools/Linux/2.6 folder)
# ---------------------------------------------------------------------
for i in `ls -d /nastools/*(N)|sed 's/.*\/\([^\/]*\)$/\1/'`
do
if [ -f $REPENV/nastools/zshrc.$i ]
then
. $REPENV/nastools/zshrc.$i
fi
done
#
# Options de shell
#
#
# Alias
#
#
# Fonctions
#
#
# Divers
#
#
# Options de shell
#
#
# Alias
#
#
# Fonctions
#
#
# Divers
#
#
# Options de shell
#
#
# Alias
#
#
# Fonctions
#
#
# Divers
#
#
# Options de shell
#
#
# Alias
#
#
# Fonctions
#
#
# Divers
#
#
# Options de shell
#
#
# Alias
#
#
# Fonctions
#
#
# Divers
#
#
# Options de shell
#
#
# Alias
#
#
# Fonctions
#
#
# Divers
#
#
# Options de shell
#
#
# Alias
#
#
# Fonctions
#
#
# Divers
#
#
# Options de shell
#
#
# Alias
#
#
# Fonctions
#
#
# Divers
#
#
# Options de shell
#
#
# Alias
#
#
# Fonctions
#
#
# Divers
#
#
# Options de shell
#
#
# Alias
#
#
# Fonctions
#
#
# Divers
#
# Specific USER GROUPS settings (according to user primary group membership)
# --------------------------------------------------------------------------
for i in $(groups $USERNAME)
do
if [ -f $REPENV/teams/zshrc.$i ]
then
. $REPENV/teams/zshrc.$i
fi
done
# Specific PROJECT GROUPS settings (according to user secondary group membership)
# -------------------------------------------------------------------------------
for i in $(groups $USERNAME)
do
if [ -f $REPENV/projects/zshrc.$i ]
then
. $REPENV/projects/zshrc.$i
fi
done
# ====================================================================== #
# SBR Server .zshrc #
# ---------------------------------------------------------------------- #
# The .zshrc file is only sourced by zsh for "interactive" shells.
#
# It should contain all parameters relevant only for interactive shells
# -- such as command aliases, terminal behaviour settings (prompt, key
# bindings, etc.) -- but not suitable for scripting (for instance aliases
# may have undesirable side effects when scripting).
# --------- #
# Shortcuts #
# --------- #
### -- Use colour output for 'ls'
# WARNING: Be sure to set the color in "auto" mode. This way, color output is
# turned on only when 'ls' is run as an interactive command. Otherwise, the
# color escape codes scramble the output and prevent using 'ls' in scripts.
alias ls="ls --color=auto"
### -- Long listing
# The default 'll' alias uses the -L switch that hides symbolic links.
# This is error-prone.
alias ll='ls -l'
# Go up one directory
alias s='cd ..'
# Vim as vi
alias vi='vim'
# Wall-e database scripts path
export PATH=/remote/projects1/intprl/delivery/walle/latest:$PATH
### -- Switch some environment variables
alias cvs_remove_status="cvs status | fgrep "Needs Checkout" | cut -f4 -d" " | cut -f1"
### Database handling
alias sqc="sqlplus $AMDORA_USER/$AMDORA_PASSWD@$AMDORA_SERVICE"
alias trc="script_sql/utility/truncate.sh $AMDORA_USER $AMDORA_PASSWD $AMDORA_SERVICE"
### -- AStyle
export ARTISTIC_STYLE_OPTIONS=/projects/dbl_pnr_/tools/astyle/etc/astylerc
# ----------------- #
# Terminal settings #
# ----------------- #
### Prompt
# Default prompt is set to '[username@host] /current/directory >'
# Prompt is also underlined to help locate it easily
# OLDPROMPT='%U[%n@%m] %~%u >'
# alias oldprompt="export PS1=\"$OLDPROMPT\"; export RPS1='%T'"
# Nicer prompt with colours, the colour of the hostname being different on Sun
# and HP machines
export PS1='%{%}%T %{%}%n%{%}@%{%}%m %{%}%~%{%}>%{%} '
unset RPS1
#
# Key bindings
#
### -- HOME
bindkey "\e[1~" beginning-of-line
### -- END
bindkey "\e[4~" end-of-line
### -- Ctrl + Left Arrow
bindkey "\eOD" backward-word
### -- Ctrl + Right Arrow
bindkey "\eOC" forward-word
### -- DEL
bindkey "\e[3~" delete-char
### -- Shift + Tab. cycle completion list in reverse order
bindkey '' reverse-menu-complete
### -- Ctrl+SPACE: history completion (backward)
bindkey "^@" history-beginning-search-backward
### -- Ctrl+Z: history completion (forward)
bindkey "^Z" history-beginning-search-forward
### -- PageUp: history completion (backward from the end)
bindkey '[5~' history-search-backward
### -- PageDown: history completion (forward from the end)
bindkey '[6~' history-search-forward
# ---- #
# Misc #
# ---- #
# Ctrl+D is the same as logout
unsetopt ignore_eof
# Specific USER home environment settings
# ---------------------------------------
#if [ -f ~/.zshrc.$LOGNAME ]
#then
# . ~/.zshrc.$LOGNAME
#fi
if [ -f ~/.zshrc.user ]
then
. ~/.zshrc.user
fi
#export TERM="xterm-256color"
# If you come from bash you might have to change your $PATH.
# export PATH=$HOME/bin:/usr/local/bin:$PATH
# Path to your oh-my-zsh installation.
export ZSH=$HOME/.oh-my-zsh
# Set name of the theme to load. Optionally, if you set this to "random"
# it'll load a random theme each time that oh-my-zsh is loaded.
# See https://github.com/robbyrussell/oh-my-zsh/wiki/Themes
ZSH_THEME="dieter"
# Uncomment the following line to use case-sensitive completion.
# CASE_SENSITIVE="true"
# Uncomment the following line to use hyphen-insensitive completion. Case
# sensitive completion must be off. _ and - will be interchangeable.
# HYPHEN_INSENSITIVE="true"
# Uncomment the following line to disable bi-weekly auto-update checks.
# DISABLE_AUTO_UPDATE="true"
# Uncomment the following line to change how often to auto-update (in days).
# export UPDATE_ZSH_DAYS=13
# Uncomment the following line to disable colors in ls.
# DISABLE_LS_COLORS="true"
# Uncomment the following line to disable auto-setting terminal title.
# DISABLE_AUTO_TITLE="true"
# Uncomment the following line to enable command auto-correction.
# ENABLE_CORRECTION="true"
# Uncomment the following line to display red dots whilst waiting for completion.
# COMPLETION_WAITING_DOTS="true"
# Uncomment the following line if you want to disable marking untracked files
# under VCS as dirty. This makes repository status check for large repositories
# much, much faster.
# DISABLE_UNTRACKED_FILES_DIRTY="true"
# Uncomment the following line if you want to change the command execution time
# stamp shown in the history command output.
# The optional three formats: "mm/dd/yyyy"|"dd.mm.yyyy"|"yyyy-mm-dd"
# HIST_STAMPS="mm/dd/yyyy"
# Would you like to use another custom folder than $ZSH/custom?
# ZSH_CUSTOM=/path/to/new-custom-folder
# Which plugins would you like to load? (plugins can be found in ~/.oh-my-zsh/plugins/*)
# Custom plugins may be added to ~/.oh-my-zsh/custom/plugins/
# Example format: plugins=(rails git textmate ruby lighthouse)
# Add wisely, as too many plugins slow down shell startup.
plugins=(python git)
source $ZSH/oh-my-zsh.sh
# Check for updates on initial load...
if [ "$DISABLE_AUTO_UPDATE" != "true" ]; then
env ZSH=$ZSH DISABLE_UPDATE_PROMPT=$DISABLE_UPDATE_PROMPT zsh -f $ZSH/tools/check_for_upgrade.sh
fi
# Initializes Oh My Zsh
# add a function path
fpath=($ZSH/functions $ZSH/completions $fpath)
# Load all stock functions (from $fpath files) called below.
autoload -U compaudit compinit
: ${ZSH_DISABLE_COMPFIX:=true}
# Set ZSH_CUSTOM to the path where your custom config files
# and plugins exists, or else we will use the default custom/
if [[ -z "$ZSH_CUSTOM" ]]; then
ZSH_CUSTOM="$ZSH/custom"
fi
# Set ZSH_CACHE_DIR to the path where cache files should be created
# or else we will use the default cache/
if [[ -z "$ZSH_CACHE_DIR" ]]; then
ZSH_CACHE_DIR="$ZSH/cache"
fi
# Load all of the config files in ~/oh-my-zsh that end in .zsh
# TIP: Add files you don't want in git to .gitignore
for config_file ($ZSH/lib/*.zsh); do
custom_config_file="${ZSH_CUSTOM}/lib/${config_file:t}"
[ -f "${custom_config_file}" ] && config_file=${custom_config_file}
source $config_file
done
## Bazaar integration
## Just works with the GIT integration just add $(bzr_prompt_info) to the PROMPT
function bzr_prompt_info() {
BZR_CB=`bzr nick 2> /dev/null | grep -v "ERROR" | cut -d ":" -f2 | awk -F / '{print "bzr::"$1}'`
if [ -n "$BZR_CB" ]; then
BZR_DIRTY=""
[[ -n `bzr status` ]] && BZR_DIRTY=" %{$fg[red]%} * %{$fg[green]%}"
echo "$ZSH_THEME_SCM_PROMPT_PREFIX$BZR_CB$BZR_DIRTY$ZSH_THEME_GIT_PROMPT_SUFFIX"
fi
}# System clipboard integration
#
# This file has support for doing system clipboard copy and paste operations
# from the command line in a generic cross-platform fashion.
#
# On OS X and Windows, the main system clipboard or "pasteboard" is used. On other
# Unix-like OSes, this considers the X Windows CLIPBOARD selection to be the
# "system clipboard", and the X Windows `xclip` command must be installed.
# clipcopy - Copy data to clipboard
#
# Usage:
#
# <command> | clipcopy - copies stdin to clipboard
#
# clipcopy <file> - copies a file's contents to clipboard
#
function clipcopy() {
emulate -L zsh
local file=$1
if [[ $OSTYPE == darwin* ]]; then
if [[ -z $file ]]; then
pbcopy
else
cat $file | pbcopy
fi
elif [[ $OSTYPE == cygwin* ]]; then
if [[ -z $file ]]; then
cat > /dev/clipboard
else
cat $file > /dev/clipboard
fi
else
if (( $+commands[xclip] )); then
if [[ -z $file ]]; then
xclip -in -selection clipboard
else
xclip -in -selection clipboard $file
fi
elif (( $+commands[xsel] )); then
if [[ -z $file ]]; then
xsel --clipboard --input
else
cat "$file" | xsel --clipboard --input
fi
else
print "clipcopy: Platform $OSTYPE not supported or xclip/xsel not installed" >&2
return 1
fi
fi
}
# clippaste - "Paste" data from clipboard to stdout
#
# Usage:
#
# clippaste - writes clipboard's contents to stdout
#
# clippaste | <command> - pastes contents and pipes it to another process
#
# clippaste > <file> - paste contents to a file
#
# Examples:
#
# # Pipe to another process
# clippaste | grep foo
#
# # Paste to a file
# clippaste > file.txt
function clippaste() {
emulate -L zsh
if [[ $OSTYPE == darwin* ]]; then
pbpaste
elif [[ $OSTYPE == cygwin* ]]; then
cat /dev/clipboard
else
if (( $+commands[xclip] )); then
xclip -out -selection clipboard
elif (( $+commands[xsel] )); then
xsel --clipboard --output
else
print "clipcopy: Platform $OSTYPE not supported or xclip/xsel not installed" >&2
return 1
fi
fi
}
# Handle completions insecurities (i.e., completion-dependent directories with
# insecure ownership or permissions) by:
#
# * Human-readably notifying the user of these insecurities.
# * Moving away all existing completion caches to a temporary directory. Since
# any of these caches may have been generated from insecure directories, they
# are all suspect now. Failing to do so typically causes subsequent compinit()
# calls to fail with "command not found: compdef" errors. (That's bad.)
function handle_completion_insecurities() {
# List of the absolute paths of all unique insecure directories, split on
# newline from compaudit()'s output resembling:
#
# There are insecure directories:
# /usr/share/zsh/site-functions
# /usr/share/zsh/5.0.6/functions
# /usr/share/zsh
# /usr/share/zsh/5.0.6
#
# Since the ignorable first line is printed to stderr and thus not captured,
# stderr is squelched to prevent this output from leaking to the user.
local -aU insecure_dirs
insecure_dirs=( ${(f@):-"$(compaudit 2>/dev/null)"} )
# If no such directories exist, get us out of here.
if (( ! ${#insecure_dirs} )); then
print "[oh-my-zsh] No insecure completion-dependent directories detected."
return
fi
# List ownership and permissions of all insecure directories.
print "[oh-my-zsh] Insecure completion-dependent directories detected:"
ls -ld "${(@)insecure_dirs}"
print "[oh-my-zsh] For safety, completions will be disabled until you manually fix all"
print "[oh-my-zsh] insecure directory permissions and ownership and restart oh-my-zsh."
print "[oh-my-zsh] See the above list for directories with group or other writability.\n"
# Locally enable the "NULL_GLOB" option, thus removing unmatched filename
# globs from argument lists *AND* printing no warning when doing so. Failing
# to do so prints an unreadable warning if no completion caches exist below.
setopt local_options null_glob
# List of the absolute paths of all unique existing completion caches.
local -aU zcompdump_files
zcompdump_files=( "${ZSH_COMPDUMP}"(.) "${ZDOTDIR:-${HOME}}"/.zcompdump* )
# Move such caches to a temporary directory.
if (( ${#zcompdump_files} )); then
# Absolute path of the directory to which such files will be moved.
local ZSH_ZCOMPDUMP_BAD_DIR="${ZSH_CACHE_DIR}/zcompdump-bad"
# List such files first.
print "[oh-my-zsh] Insecure completion caches also detected:"
ls -l "${(@)zcompdump_files}"
# For safety, move rather than permanently remove such files.
print "[oh-my-zsh] Moving to \"${ZSH_ZCOMPDUMP_BAD_DIR}/\"...\n"
mkdir -p "${ZSH_ZCOMPDUMP_BAD_DIR}"
mv "${(@)zcompdump_files}" "${ZSH_ZCOMPDUMP_BAD_DIR}/"
fi
}
# fixme - the load process here seems a bit bizarre
zmodload -i zsh/complist
WORDCHARS=''
unsetopt menu_complete # do not autoselect the first completion entry
unsetopt flowcontrol
setopt auto_menu # show completion menu on successive tab press
setopt complete_in_word
setopt always_to_end
# should this be in keybindings?
bindkey -M menuselect '^o' accept-and-infer-next-history
zstyle ':completion:*:*:*:*:*' menu select
# case insensitive (all), partial-word and substring completion
if [[ "$CASE_SENSITIVE" = true ]]; then
zstyle ':completion:*' matcher-list 'r:|=*' 'l:|=* r:|=*'
else
if [[ "$HYPHEN_INSENSITIVE" = true ]]; then
zstyle ':completion:*' matcher-list 'm:{a-zA-Z-_}={A-Za-z_-}' 'r:|=*' 'l:|=* r:|=*'
else
zstyle ':completion:*' matcher-list 'm:{a-zA-Z}={A-Za-z}' 'r:|=*' 'l:|=* r:|=*'
fi
fi
unset CASE_SENSITIVE HYPHEN_INSENSITIVE
zstyle ':completion:*' list-colors ''
zstyle ':completion:*:*:kill:*:processes' list-colors '=(#b) #([0-9]#) ([0-9a-z-]#)*=01;34=0=01'
if [[ "$OSTYPE" = solaris* ]]; then
zstyle ':completion:*:*:*:*:processes' command "ps -u $USER -o pid,user,comm"
else
zstyle ':completion:*:*:*:*:processes' command "ps -u $USER -o pid,user,comm -w -w"
fi
# disable named-directories autocompletion
zstyle ':completion:*:cd:*' tag-order local-directories directory-stack path-directories
# Use caching so that commands like apt and dpkg complete are useable
zstyle ':completion::complete:*' use-cache 1
zstyle ':completion::complete:*' cache-path $ZSH_CACHE_DIR
# Don't complete uninteresting users
zstyle ':completion:*:*:*:users' ignored-patterns \
adm amanda apache at avahi avahi-autoipd beaglidx bin cacti canna \
clamav daemon dbus distcache dnsmasq dovecot fax ftp games gdm \
gkrellmd gopher hacluster haldaemon halt hsqldb ident junkbust kdm \
ldap lp mail mailman mailnull man messagebus mldonkey mysql nagios \
named netdump news nfsnobody nobody nscd ntp nut nx obsrun openvpn \
operator pcap polkitd postfix postgres privoxy pulse pvm quagga radvd \
rpc rpcuser rpm rtkit scard shutdown squid sshd statd svn sync tftp \
usbmux uucp vcsa wwwrun xfs '_*'
# ... unless we really want to.
zstyle '*' single-ignored show
if [[ $COMPLETION_WAITING_DOTS = true ]]; then
expand-or-complete-with-dots() {
# toggle line-wrapping off and back on again
[[ -n "$terminfo[rmam]" && -n "$terminfo[smam]" ]] && echoti rmam
print -Pn "%{%F{red}......%f%}"
[[ -n "$terminfo[rmam]" && -n "$terminfo[smam]" ]] && echoti smam
zle expand-or-complete
zle redisplay
}
zle -N expand-or-complete-with-dots
bindkey "^I" expand-or-complete-with-dots
fi
if [[ "$ENABLE_CORRECTION" == "true" ]]; then
alias ebuild='nocorrect ebuild'
alias gist='nocorrect gist'
alias heroku='nocorrect heroku'
alias hpodder='nocorrect hpodder'
alias man='nocorrect man'
alias mkdir='nocorrect mkdir'
alias mv='nocorrect mv'
alias mysql='nocorrect mysql'
alias sudo='nocorrect sudo'
setopt correct_all
fi
# diagnostics.zsh
#
# Diagnostic and debugging support for oh-my-zsh
# omz_diagnostic_dump()
#
# Author: Andrew Janke <andrew@apjanke.net>
#
# Usage:
#
# omz_diagnostic_dump [-v] [-V] [file]
#
# NOTE: This is a work in progress. Its interface and behavior are going to change,
# and probably in non-back-compatible ways.
#
# Outputs a bunch of information about the state and configuration of
# oh-my-zsh, zsh, and the user's system. This is intended to provide a
# bunch of context for diagnosing your own or a third party's problems, and to
# be suitable for posting to public bug reports.
#
# The output is human-readable and its format may change over time. It is not
# suitable for parsing. All the output is in one single file so it can be posted
# as a gist or bug comment on GitHub. GitHub doesn't support attaching tarballs
# or other files to bugs; otherwise, this would probably have an option to produce
# tarballs that contain copies of the config and customization files instead of
# catting them all in to one file.
#
# This is intended to be widely portable, and run anywhere that oh-my-zsh does.
# Feel free to report any portability issues as bugs.
#
# This is written in a defensive style so it still works (and can detect) cases when
# basic functionality like echo and which have been redefined. In particular, almost
# everything is invoked with "builtin" or "command", to work in the face of user
# redefinitions.
#
# OPTIONS
#
# [file] Specifies the output file. If not given, a file in the current directory
# is selected automatically.
#
# -v Increase the verbosity of the dump output. May be specified multiple times.
# Verbosity levels:
# 0 - Basic info, shell state, omz configuration, git state
# 1 - (default) Adds key binding info and configuration file contents
# 2 - Adds zcompdump file contents
#
# -V Reduce the verbosity of the dump output. May be specified multiple times.
#
# TODO:
# * Multi-file capture
# * Add automatic gist uploading
# * Consider whether to move default output file location to TMPDIR. More robust
# but less user friendly.
#
autoload -Uz is-at-least
function omz_diagnostic_dump() {
emulate -L zsh
builtin echo "Generating diagnostic dump; please be patient..."
local thisfcn=omz_diagnostic_dump
local -A opts
local opt_verbose opt_noverbose opt_outfile
local timestamp=$(date +%Y%m%d-%H%M%S)
local outfile=omz_diagdump_$timestamp.txt
builtin zparseopts -A opts -D -- "v+=opt_verbose" "V+=opt_noverbose"
local verbose n_verbose=${#opt_verbose} n_noverbose=${#opt_noverbose}
(( verbose = 1 + n_verbose - n_noverbose ))
if [[ ${#*} > 0 ]]; then
opt_outfile=$1
fi
if [[ ${#*} > 1 ]]; then
builtin echo "$thisfcn: error: too many arguments" >&2
return 1
fi
if [[ -n "$opt_outfile" ]]; then
outfile="$opt_outfile"
fi
# Always write directly to a file so terminal escape sequences are
# captured cleanly
_omz_diag_dump_one_big_text &> "$outfile"
if [[ $? != 0 ]]; then
builtin echo "$thisfcn: error while creating diagnostic dump; see $outfile for details"
fi
builtin echo
builtin echo Diagnostic dump file created at: "$outfile"
builtin echo
builtin echo To share this with OMZ developers, post it as a gist on GitHub
builtin echo at "https://gist.github.com" and share the link to the gist.
builtin echo
builtin echo "WARNING: This dump file contains all your zsh and omz configuration files,"
builtin echo "so don't share it publicly if there's sensitive information in them."
builtin echo
}
function _omz_diag_dump_one_big_text() {
local program programs progfile md5
builtin echo oh-my-zsh diagnostic dump
builtin echo
builtin echo $outfile
builtin echo
# Basic system and zsh information
command date
command uname -a
builtin echo OSTYPE=$OSTYPE
builtin echo ZSH_VERSION=$ZSH_VERSION
builtin echo User: $USER
builtin echo umask: $(umask)
builtin echo
_omz_diag_dump_os_specific_version
builtin echo
# Installed programs
programs=(sh zsh ksh bash sed cat grep ls find git posh)
local progfile="" extra_str="" sha_str=""
for program in $programs; do
extra_str="" sha_str=""
progfile=$(builtin which $program)
if [[ $? == 0 ]]; then
if [[ -e $progfile ]]; then
if builtin whence shasum &>/dev/null; then
sha_str=($(command shasum $progfile))
sha_str=$sha_str[1]
extra_str+=" SHA $sha_str"
fi
if [[ -h "$progfile" ]]; then
extra_str+=" ( -> ${progfile:A} )"
fi
fi
builtin printf '%-9s %-20s %s\n' "$program is" "$progfile" "$extra_str"
else
builtin echo "$program: not found"
fi
done
builtin echo
builtin echo Command Versions:
builtin echo "zsh: $(zsh --version)"
builtin echo "this zsh session: $ZSH_VERSION"
builtin echo "bash: $(bash --version | command grep bash)"
builtin echo "git: $(git --version)"
builtin echo "grep: $(grep --version)"
builtin echo
# Core command definitions
_omz_diag_dump_check_core_commands || return 1
builtin echo
# ZSH Process state
builtin echo Process state:
builtin echo pwd: $PWD
if builtin whence pstree &>/dev/null; then
builtin echo Process tree for this shell:
pstree -p $$
else
ps -fT
fi
builtin set | command grep -a '^\(ZSH\|plugins\|TERM\|LC_\|LANG\|precmd\|chpwd\|preexec\|FPATH\|TTY\|DISPLAY\|PATH\)\|OMZ'
builtin echo
#TODO: Should this include `env` instead of or in addition to `export`?
builtin echo Exported:
builtin echo $(builtin export | command sed 's/=.*//')
builtin echo
builtin echo Locale:
command locale
builtin echo
# Zsh installation and configuration
builtin echo Zsh configuration:
builtin echo setopt: $(builtin setopt)
builtin echo
builtin echo zstyle:
builtin zstyle
builtin echo
builtin echo 'compaudit output:'
compaudit
builtin echo
builtin echo '$fpath directories:'
command ls -lad $fpath
builtin echo
# Oh-my-zsh installation
builtin echo oh-my-zsh installation:
command ls -ld ~/.z*
command ls -ld ~/.oh*
builtin echo
builtin echo oh-my-zsh git state:
(cd $ZSH && builtin echo "HEAD: $(git rev-parse HEAD)" && git remote -v && git status | command grep "[^[:space:]]")
if [[ $verbose -ge 1 ]]; then
(cd $ZSH && git reflog --date=default | command grep pull)
fi
builtin echo
if [[ -e $ZSH_CUSTOM ]]; then
local custom_dir=$ZSH_CUSTOM
if [[ -h $custom_dir ]]; then
custom_dir=$(cd $custom_dir && pwd -P)
fi
builtin echo "oh-my-zsh custom dir:"
builtin echo " $ZSH_CUSTOM ($custom_dir)"
(cd ${custom_dir:h} && command find ${custom_dir:t} -name .git -prune -o -print)
builtin echo
fi
# Key binding and terminal info
if [[ $verbose -ge 1 ]]; then
builtin echo "bindkey:"
builtin bindkey
builtin echo
builtin echo "infocmp:"
command infocmp -L
builtin echo
fi
# Configuration file info
local zdotdir=${ZDOTDIR:-$HOME}
builtin echo "Zsh configuration files:"
local cfgfile cfgfiles
# Some files for bash that zsh does not use are intentionally included
# to help with diagnosing behavior differences between bash and zsh
cfgfiles=( /etc/zshenv /etc/zprofile /etc/zshrc /etc/zlogin /etc/zlogout
$zdotdir/.zshenv $zdotdir/.zprofile $zdotdir/.zshrc $zdotdir/.zlogin $zdotdir/.zlogout
~/.zsh.pre-oh-my-zsh
/etc/bashrc /etc/profile ~/.bashrc ~/.profile ~/.bash_profile ~/.bash_logout )
command ls -lad $cfgfiles 2>&1
builtin echo
if [[ $verbose -ge 1 ]]; then
for cfgfile in $cfgfiles; do
_omz_diag_dump_echo_file_w_header $cfgfile
done
fi
builtin echo
builtin echo "Zsh compdump files:"
local dumpfile dumpfiles
command ls -lad $zdotdir/.zcompdump*
dumpfiles=( $zdotdir/.zcompdump*(N) )
if [[ $verbose -ge 2 ]]; then
for dumpfile in $dumpfiles; do
_omz_diag_dump_echo_file_w_header $dumpfile
done
fi
}
function _omz_diag_dump_check_core_commands() {
builtin echo "Core command check:"
local redefined name builtins externals reserved_words
redefined=()
# All the zsh non-module builtin commands
# These are taken from the zsh reference manual for 5.0.2
# Commands from modules should not be included.
# (For back-compatibility, if any of these are newish, they should be removed,
# or at least made conditional on the version of the current running zsh.)
# "history" is also excluded because OMZ is known to redefine that
reserved_words=( do done esac then elif else fi for case if while function
repeat time until select coproc nocorrect foreach end '!' '[[' '{' '}'
)
builtins=( alias autoload bg bindkey break builtin bye cd chdir command
comparguments compcall compctl compdescribe compfiles compgroups compquote comptags
comptry compvalues continue dirs disable disown echo echotc echoti emulate
enable eval exec exit false fc fg functions getln getopts hash
jobs kill let limit log logout noglob popd print printf
pushd pushln pwd r read rehash return sched set setopt shift
source suspend test times trap true ttyctl type ulimit umask unalias
unfunction unhash unlimit unset unsetopt vared wait whence where which zcompile
zle zmodload zparseopts zregexparse zstyle )
if is-at-least 5.1; then
reserved_word+=( declare export integer float local readonly typeset )
else
builtins+=( declare export integer float local readonly typeset )
fi
builtins_fatal=( builtin command local )
externals=( zsh )
for name in $reserved_words; do
if [[ $(builtin whence -w $name) != "$name: reserved" ]]; then
builtin echo "reserved word '$name' has been redefined"
builtin which $name
redefined+=$name
fi
done
for name in $builtins; do
if [[ $(builtin whence -w $name) != "$name: builtin" ]]; then
builtin echo "builtin '$name' has been redefined"
builtin which $name
redefined+=$name
fi
done
for name in $externals; do
if [[ $(builtin whence -w $name) != "$name: command" ]]; then
builtin echo "command '$name' has been redefined"
builtin which $name
redefined+=$name
fi
done
if [[ -n "$redefined" ]]; then
builtin echo "SOME CORE COMMANDS HAVE BEEN REDEFINED: $redefined"
else
builtin echo "All core commands are defined normally"
fi
}
function _omz_diag_dump_echo_file_w_header() {
local file=$1
if [[ ( -f $file || -h $file ) ]]; then
builtin echo "========== $file =========="
if [[ -h $file ]]; then
builtin echo "========== ( => ${file:A} ) =========="
fi
command cat $file
builtin echo "========== end $file =========="
builtin echo
elif [[ -d $file ]]; then
builtin echo "File '$file' is a directory"
elif [[ ! -e $file ]]; then
builtin echo "File '$file' does not exist"
else
command ls -lad "$file"
fi
}
function _omz_diag_dump_os_specific_version() {
local osname osver version_file version_files
case "$OSTYPE" in
darwin*)
osname=$(command sw_vers -productName)
osver=$(command sw_vers -productVersion)
builtin echo "OS Version: $osname $osver build $(sw_vers -buildVersion)"
;;
cygwin)
command systeminfo | command head -4 | command tail -2
;;
esac
if builtin which lsb_release >/dev/null; then
builtin echo "OS Release: $(command lsb_release -s -d)"
fi
version_files=( /etc/*-release(N) /etc/*-version(N) /etc/*_version(N) )
for version_file in $version_files; do
builtin echo "$version_file:"
command cat "$version_file"
builtin echo
done
}
# Changing/making/removing directory
setopt auto_pushd
setopt pushd_ignore_dups
setopt pushdminus
alias -g ...='../..'
alias -g ....='../../..'
alias -g .....='../../../..'
alias -g ......='../../../../..'
alias -- -='cd -'
alias 1='cd -'
alias 2='cd -2'
alias 3='cd -3'
alias 4='cd -4'
alias 5='cd -5'
alias 6='cd -6'
alias 7='cd -7'
alias 8='cd -8'
alias 9='cd -9'
alias md='mkdir -p'
alias rd=rmdir
alias d='dirs -v | head -10'
# List directory contents
alias lsa='ls -lah'
alias l='ls -lah'
alias ll='ls -lh'
alias la='ls -lAh'
# Push and pop directories on directory stack
alias pu='pushd'
alias po='popd'
function zsh_stats() {
fc -l 1 | awk '{CMD[$2]++;count++;}END { for (a in CMD)print CMD[a] " " CMD[a]/count*100 "% " a;}' | grep -v "./" | column -c3 -s " " -t | sort -nr | nl | head -n20
}
function uninstall_oh_my_zsh() {
env ZSH=$ZSH sh $ZSH/tools/uninstall.sh
}
function upgrade_oh_my_zsh() {
env ZSH=$ZSH sh $ZSH/tools/upgrade.sh
}
function take() {
mkdir -p $1
cd $1
}
function open_command() {
emulate -L zsh
setopt shwordsplit
local open_cmd
# define the open command
case "$OSTYPE" in
darwin*) open_cmd='open' ;;
cygwin*) open_cmd='cygstart' ;;
linux*) open_cmd='xdg-open' ;;
msys*) open_cmd='start ""' ;;
*) echo "Platform $OSTYPE not supported"
return 1
;;
esac
# don't use nohup on OSX
if [[ "$OSTYPE" == darwin* ]]; then
$open_cmd "$@" &>/dev/null
else
nohup $open_cmd "$@" &>/dev/null
fi
}
#
# Get the value of an alias.
#
# Arguments:
# 1. alias - The alias to get its value from
# STDOUT:
# The value of alias $1 (if it has one).
# Return value:
# 0 if the alias was found,
# 1 if it does not exist
#
function alias_value() {
alias "$1" | sed "s/^$1='\(.*\)'$/\1/"
test $(alias "$1")
}
#
# Try to get the value of an alias,
# otherwise return the input.
#
# Arguments:
# 1. alias - The alias to get its value from
# STDOUT:
# The value of alias $1, or $1 if there is no alias $1.
# Return value:
# Always 0
#
function try_alias_value() {
alias_value "$1" || echo "$1"
}
#
# Set variable "$1" to default value "$2" if "$1" is not yet defined.
#
# Arguments:
# 1. name - The variable to set
# 2. val - The default value
# Return value:
# 0 if the variable exists, 3 if it was set
#
function default() {
test `typeset +m "$1"` && return 0
typeset -g "$1"="$2" && return 3
}
#
# Set environment variable "$1" to default value "$2" if "$1" is not yet defined.
#
# Arguments:
# 1. name - The env variable to set
# 2. val - The default value
# Return value:
# 0 if the env variable exists, 3 if it was set
#
function env_default() {
env | grep -q "^$1=" && return 0
export "$1=$2" && return 3
}
# Required for $langinfo
zmodload zsh/langinfo
# URL-encode a string
#
# Encodes a string using RFC 2396 URL-encoding (%-escaped).
# See: https://www.ietf.org/rfc/rfc2396.txt
#
# By default, reserved characters and unreserved "mark" characters are
# not escaped by this function. This allows the common usage of passing
# an entire URL in, and encoding just special characters in it, with
# the expectation that reserved and mark characters are used appropriately.
# The -r and -m options turn on escaping of the reserved and mark characters,
# respectively, which allows arbitrary strings to be fully escaped for
# embedding inside URLs, where reserved characters might be misinterpreted.
#
# Prints the encoded string on stdout.
# Returns nonzero if encoding failed.
#
# Usage:
# omz_urlencode [-r] [-m] [-P] <string>
#
# -r causes reserved characters (;/?:@&=+$,) to be escaped
#
# -m causes "mark" characters (_.!~*''()-) to be escaped
#
# -P causes spaces to be encoded as '%20' instead of '+'
function omz_urlencode() {
emulate -L zsh
zparseopts -D -E -a opts r m P
local in_str=$1
local url_str=""
local spaces_as_plus
if [[ -z $opts[(r)-P] ]]; then spaces_as_plus=1; fi
local str="$in_str"
# URLs must use UTF-8 encoding; convert str to UTF-8 if required
local encoding=$langinfo[CODESET]
local safe_encodings
safe_encodings=(UTF-8 utf8 US-ASCII)
if [[ -z ${safe_encodings[(r)$encoding]} ]]; then
str=$(echo -E "$str" | iconv -f $encoding -t UTF-8)
if [[ $? != 0 ]]; then
echo "Error converting string from $encoding to UTF-8" >&2
return 1
fi
fi
# Use LC_CTYPE=C to process text byte-by-byte
local i byte ord LC_ALL=C
export LC_ALL
local reserved=';/?:@&=+$,'
local mark='_.!~*''()-'
local dont_escape="[A-Za-z0-9"
if [[ -z $opts[(r)-r] ]]; then
dont_escape+=$reserved
fi
# $mark must be last because of the "-"
if [[ -z $opts[(r)-m] ]]; then
dont_escape+=$mark
fi
dont_escape+="]"
# Implemented to use a single printf call and avoid subshells in the loop,
# for performance (primarily on Windows).
local url_str=""
for (( i = 1; i <= ${#str}; ++i )); do
byte="$str[i]"
if [[ "$byte" =~ "$dont_escape" ]]; then
url_str+="$byte"
else
if [[ "$byte" == " " && -n $spaces_as_plus ]]; then
url_str+="+"
else
ord=$(( [##16] #byte ))
url_str+="%$ord"
fi
fi
done
echo -E "$url_str"
}
# URL-decode a string
#
# Decodes a RFC 2396 URL-encoded (%-escaped) string.
# This decodes the '+' and '%' escapes in the input string, and leaves
# other characters unchanged. Does not enforce that the input is a
# valid URL-encoded string. This is a convenience to allow callers to
# pass in a full URL or similar strings and decode them for human
# presentation.
#
# Outputs the encoded string on stdout.
# Returns nonzero if encoding failed.
#
# Usage:
# omz_urldecode <urlstring> - prints decoded string followed by a newline
function omz_urldecode {
emulate -L zsh
local encoded_url=$1
# Work bytewise, since URLs escape UTF-8 octets
local caller_encoding=$langinfo[CODESET]
local LC_ALL=C
export LC_ALL
# Change + back to ' '
local tmp=${encoded_url:gs/+/ /}
# Protect other escapes to pass through the printf unchanged
tmp=${tmp:gs/\\/\\\\/}
# Handle %-escapes by turning them into `\xXX` printf escapes
tmp=${tmp:gs/%/\\x/}
local decoded
eval "decoded=\$'$tmp'"
# Now we have a UTF-8 encoded string in the variable. We need to re-encode
# it if caller is in a non-UTF-8 locale.
local safe_encodings
safe_encodings=(UTF-8 utf8 US-ASCII)
if [[ -z ${safe_encodings[(r)$caller_encoding]} ]]; then
decoded=$(echo -E "$decoded" | iconv -f UTF-8 -t $caller_encoding)
if [[ $? != 0 ]]; then
echo "Error converting string from UTF-8 to $caller_encoding" >&2
return 1
fi
fi
echo -E "$decoded"
}
# Outputs current branch info in prompt format
function git_prompt_info() {
local ref
if [[ "$(command git config --get oh-my-zsh.hide-status 2>/dev/null)" != "1" ]]; then
ref=$(command git symbolic-ref HEAD 2> /dev/null) || \
ref=$(command git rev-parse --short HEAD 2> /dev/null) || return 0
echo "$ZSH_THEME_GIT_PROMPT_PREFIX${ref#refs/heads/}$(parse_git_dirty)$ZSH_THEME_GIT_PROMPT_SUFFIX"
fi
}
# Checks if working tree is dirty
function parse_git_dirty() {
local STATUS=''
local -a FLAGS
FLAGS=('--porcelain')
if [[ "$(command git config --get oh-my-zsh.hide-dirty)" != "1" ]]; then
if [[ $POST_1_7_2_GIT -gt 0 ]]; then
FLAGS+='--ignore-submodules=dirty'
fi
if [[ "$DISABLE_UNTRACKED_FILES_DIRTY" == "true" ]]; then
FLAGS+='--untracked-files=no'
fi
STATUS=$(command git status ${FLAGS} 2> /dev/null | tail -n1)
fi
if [[ -n $STATUS ]]; then
echo "$ZSH_THEME_GIT_PROMPT_DIRTY"
else
echo "$ZSH_THEME_GIT_PROMPT_CLEAN"
fi
}
# Gets the difference between the local and remote branches
function git_remote_status() {
local remote ahead behind git_remote_status git_remote_status_detailed
remote=${$(command git rev-parse --verify ${hook_com[branch]}@{upstream} --symbolic-full-name 2>/dev/null)/refs\/remotes\/}
if [[ -n ${remote} ]]; then
ahead=$(command git rev-list ${hook_com[branch]}@{upstream}..HEAD 2>/dev/null | wc -l)
behind=$(command git rev-list HEAD..${hook_com[branch]}@{upstream} 2>/dev/null | wc -l)
if [[ $ahead -eq 0 ]] && [[ $behind -eq 0 ]]; then
git_remote_status="$ZSH_THEME_GIT_PROMPT_EQUAL_REMOTE"
elif [[ $ahead -gt 0 ]] && [[ $behind -eq 0 ]]; then
git_remote_status="$ZSH_THEME_GIT_PROMPT_AHEAD_REMOTE"
git_remote_status_detailed="$ZSH_THEME_GIT_PROMPT_AHEAD_REMOTE_COLOR$ZSH_THEME_GIT_PROMPT_AHEAD_REMOTE$((ahead))%{$reset_color%}"
elif [[ $behind -gt 0 ]] && [[ $ahead -eq 0 ]]; then
git_remote_status="$ZSH_THEME_GIT_PROMPT_BEHIND_REMOTE"
git_remote_status_detailed="$ZSH_THEME_GIT_PROMPT_BEHIND_REMOTE_COLOR$ZSH_THEME_GIT_PROMPT_BEHIND_REMOTE$((behind))%{$reset_color%}"
elif [[ $ahead -gt 0 ]] && [[ $behind -gt 0 ]]; then
git_remote_status="$ZSH_THEME_GIT_PROMPT_DIVERGED_REMOTE"
git_remote_status_detailed="$ZSH_THEME_GIT_PROMPT_AHEAD_REMOTE_COLOR$ZSH_THEME_GIT_PROMPT_AHEAD_REMOTE$((ahead))%{$reset_color%}$ZSH_THEME_GIT_PROMPT_BEHIND_REMOTE_COLOR$ZSH_THEME_GIT_PROMPT_BEHIND_REMOTE$((behind))%{$reset_color%}"
fi
if [[ -n $ZSH_THEME_GIT_PROMPT_REMOTE_STATUS_DETAILED ]]; then
git_remote_status="$ZSH_THEME_GIT_PROMPT_REMOTE_STATUS_PREFIX$remote$git_remote_status_detailed$ZSH_THEME_GIT_PROMPT_REMOTE_STATUS_SUFFIX"
fi
echo $git_remote_status
fi
}
# Outputs the name of the current branch
# Usage example: git pull origin $(git_current_branch)
# Using '--quiet' with 'symbolic-ref' will not cause a fatal error (128) if
# it's not a symbolic ref, but in a Git repo.
function git_current_branch() {
local ref
ref=$(command git symbolic-ref --quiet HEAD 2> /dev/null)
local ret=$?
if [[ $ret != 0 ]]; then
[[ $ret == 128 ]] && return # no git repo.
ref=$(command git rev-parse --short HEAD 2> /dev/null) || return
fi
echo ${ref#refs/heads/}
}
# Gets the number of commits ahead from remote
function git_commits_ahead() {
if command git rev-parse --git-dir &>/dev/null; then
local commits="$(git rev-list --count @{upstream}..HEAD)"
if [[ "$commits" != 0 ]]; then
echo "$ZSH_THEME_GIT_COMMITS_AHEAD_PREFIX$commits$ZSH_THEME_GIT_COMMITS_AHEAD_SUFFIX"
fi
fi
}
# Gets the number of commits behind remote
function git_commits_behind() {
if command git rev-parse --git-dir &>/dev/null; then
local commits="$(git rev-list --count HEAD..@{upstream})"
if [[ "$commits" != 0 ]]; then
echo "$ZSH_THEME_GIT_COMMITS_BEHIND_PREFIX$commits$ZSH_THEME_GIT_COMMITS_BEHIND_SUFFIX"
fi
fi
}
# Outputs if current branch is ahead of remote
function git_prompt_ahead() {
if [[ -n "$(command git rev-list origin/$(git_current_branch)..HEAD 2> /dev/null)" ]]; then
echo "$ZSH_THEME_GIT_PROMPT_AHEAD"
fi
}
# Outputs if current branch is behind remote
function git_prompt_behind() {
if [[ -n "$(command git rev-list HEAD..origin/$(git_current_branch) 2> /dev/null)" ]]; then
echo "$ZSH_THEME_GIT_PROMPT_BEHIND"
fi
}
# Outputs if current branch exists on remote or not
function git_prompt_remote() {
if [[ -n "$(command git show-ref origin/$(git_current_branch) 2> /dev/null)" ]]; then
echo "$ZSH_THEME_GIT_PROMPT_REMOTE_EXISTS"
else
echo "$ZSH_THEME_GIT_PROMPT_REMOTE_MISSING"
fi
}
# Formats prompt string for current git commit short SHA
function git_prompt_short_sha() {
local SHA
SHA=$(command git rev-parse --short HEAD 2> /dev/null) && echo "$ZSH_THEME_GIT_PROMPT_SHA_BEFORE$SHA$ZSH_THEME_GIT_PROMPT_SHA_AFTER"
}
# Formats prompt string for current git commit long SHA
function git_prompt_long_sha() {
local SHA
SHA=$(command git rev-parse HEAD 2> /dev/null) && echo "$ZSH_THEME_GIT_PROMPT_SHA_BEFORE$SHA$ZSH_THEME_GIT_PROMPT_SHA_AFTER"
}
# Get the status of the working tree
function git_prompt_status() {
local INDEX STATUS
INDEX=$(command git status --porcelain -b 2> /dev/null)
STATUS=""
if $(echo "$INDEX" | command grep -E '^\?\? ' &> /dev/null); then
STATUS="$ZSH_THEME_GIT_PROMPT_UNTRACKED$STATUS"
fi
if $(echo "$INDEX" | grep '^A ' &> /dev/null); then
STATUS="$ZSH_THEME_GIT_PROMPT_ADDED$STATUS"
elif $(echo "$INDEX" | grep '^M ' &> /dev/null); then
STATUS="$ZSH_THEME_GIT_PROMPT_ADDED$STATUS"
fi
if $(echo "$INDEX" | grep '^ M ' &> /dev/null); then
STATUS="$ZSH_THEME_GIT_PROMPT_MODIFIED$STATUS"
elif $(echo "$INDEX" | grep '^AM ' &> /dev/null); then
STATUS="$ZSH_THEME_GIT_PROMPT_MODIFIED$STATUS"
elif $(echo "$INDEX" | grep '^ T ' &> /dev/null); then
STATUS="$ZSH_THEME_GIT_PROMPT_MODIFIED$STATUS"
fi
if $(echo "$INDEX" | grep '^R ' &> /dev/null); then
STATUS="$ZSH_THEME_GIT_PROMPT_RENAMED$STATUS"
fi
if $(echo "$INDEX" | grep '^ D ' &> /dev/null); then
STATUS="$ZSH_THEME_GIT_PROMPT_DELETED$STATUS"
elif $(echo "$INDEX" | grep '^D ' &> /dev/null); then
STATUS="$ZSH_THEME_GIT_PROMPT_DELETED$STATUS"
elif $(echo "$INDEX" | grep '^AD ' &> /dev/null); then
STATUS="$ZSH_THEME_GIT_PROMPT_DELETED$STATUS"
fi
if $(command git rev-parse --verify refs/stash >/dev/null 2>&1); then
STATUS="$ZSH_THEME_GIT_PROMPT_STASHED$STATUS"
fi
if $(echo "$INDEX" | grep '^UU ' &> /dev/null); then
STATUS="$ZSH_THEME_GIT_PROMPT_UNMERGED$STATUS"
fi
if $(echo "$INDEX" | grep '^## [^ ]\+ .*ahead' &> /dev/null); then
STATUS="$ZSH_THEME_GIT_PROMPT_AHEAD$STATUS"
fi
if $(echo "$INDEX" | grep '^## [^ ]\+ .*behind' &> /dev/null); then
STATUS="$ZSH_THEME_GIT_PROMPT_BEHIND$STATUS"
fi
if $(echo "$INDEX" | grep '^## [^ ]\+ .*diverged' &> /dev/null); then
STATUS="$ZSH_THEME_GIT_PROMPT_DIVERGED$STATUS"
fi
echo $STATUS
}
# Compares the provided version of git to the version installed and on path
# Outputs -1, 0, or 1 if the installed version is less than, equal to, or
# greater than the input version, respectively.
function git_compare_version() {
local INPUT_GIT_VERSION INSTALLED_GIT_VERSION
INPUT_GIT_VERSION=(${(s/./)1})
INSTALLED_GIT_VERSION=($(command git --version 2>/dev/null))
INSTALLED_GIT_VERSION=(${(s/./)INSTALLED_GIT_VERSION[3]})
for i in {1..3}; do
if [[ $INSTALLED_GIT_VERSION[$i] -gt $INPUT_GIT_VERSION[$i] ]]; then
echo 1
return 0
fi
if [[ $INSTALLED_GIT_VERSION[$i] -lt $INPUT_GIT_VERSION[$i] ]]; then
echo -1
return 0
fi
done
echo 0
}
# Outputs the name of the current user
# Usage example: $(git_current_user_name)
function git_current_user_name() {
command git config user.name 2>/dev/null
}
# Outputs the email of the current user
# Usage example: $(git_current_user_email)
function git_current_user_email() {
command git config user.email 2>/dev/null
}
# This is unlikely to change so make it all statically assigned
POST_1_7_2_GIT=$(git_compare_version "1.7.2")
# Clean up the namespace slightly by removing the checker function
unfunction git_compare_version
# is x grep argument available?
grep-flag-available() {
echo | grep $1 "" >/dev/null 2>&1
}
GREP_OPTIONS=""
# color grep results
if grep-flag-available --color=auto; then
GREP_OPTIONS+=" --color=auto"
fi
# ignore VCS folders (if the necessary grep flags are available)
VCS_FOLDERS="{.bzr,CVS,.git,.hg,.svn}"
if grep-flag-available --exclude-dir=.cvs; then
GREP_OPTIONS+=" --exclude-dir=$VCS_FOLDERS"
elif grep-flag-available --exclude=.cvs; then
GREP_OPTIONS+=" --exclude=$VCS_FOLDERS"
fi
# export grep settings
alias grep="grep $GREP_OPTIONS"
# clean up
unset GREP_OPTIONS
unset VCS_FOLDERS
unfunction grep-flag-available
## Command history configuration
if [ -z "$HISTFILE" ]; then
HISTFILE=$HOME/.zsh_history
fi
HISTSIZE=10000
SAVEHIST=10000
# Show history
case $HIST_STAMPS in
"mm/dd/yyyy") alias history='fc -fl 1' ;;
"dd.mm.yyyy") alias history='fc -El 1' ;;
"yyyy-mm-dd") alias history='fc -il 1' ;;
*) alias history='fc -l 1' ;;
esac
setopt append_history
setopt extended_history
setopt hist_expire_dups_first
setopt hist_ignore_dups # ignore duplication command history list
setopt hist_ignore_space
setopt hist_verify
setopt inc_append_history
setopt share_history # share command history data
# http://zsh.sourceforge.net/Doc/Release/Zsh-Line-Editor.html
# http://zsh.sourceforge.net/Doc/Release/Zsh-Line-Editor.html#Zle-Builtins
# http://zsh.sourceforge.net/Doc/Release/Zsh-Line-Editor.html#Standard-Widgets
# Make sure that the terminal is in application mode when zle is active, since
# only then values from $terminfo are valid
if (( ${+terminfo[smkx]} )) && (( ${+terminfo[rmkx]} )); then
function zle-line-init() {
echoti smkx
}
function zle-line-finish() {
echoti rmkx
}
zle -N zle-line-init
zle -N zle-line-finish
fi
bindkey -e # Use emacs key bindings
bindkey '\ew' kill-region # [Esc-w] - Kill from the cursor to the mark
bindkey -s '\el' 'ls\n' # [Esc-l] - run command: ls
bindkey '^r' history-incremental-search-backward # [Ctrl-r] - Search backward incrementally for a specified string. The string may begin with ^ to anchor the search to the beginning of the line.
if [[ "${terminfo[kpp]}" != "" ]]; then
bindkey "${terminfo[kpp]}" up-line-or-history # [PageUp] - Up a line of history
fi
if [[ "${terminfo[knp]}" != "" ]]; then
bindkey "${terminfo[knp]}" down-line-or-history # [PageDown] - Down a line of history
fi
# start typing + [Up-Arrow] - fuzzy find history forward
if [[ "${terminfo[kcuu1]}" != "" ]]; then
autoload -U up-line-or-beginning-search
zle -N up-line-or-beginning-search
bindkey "${terminfo[kcuu1]}" up-line-or-beginning-search
fi
# start typing + [Down-Arrow] - fuzzy find history backward
if [[ "${terminfo[kcud1]}" != "" ]]; then
autoload -U down-line-or-beginning-search
zle -N down-line-or-beginning-search
bindkey "${terminfo[kcud1]}" down-line-or-beginning-search
fi
if [[ "${terminfo[khome]}" != "" ]]; then
bindkey "${terminfo[khome]}" beginning-of-line # [Home] - Go to beginning of line
fi
if [[ "${terminfo[kend]}" != "" ]]; then
bindkey "${terminfo[kend]}" end-of-line # [End] - Go to end of line
fi
bindkey ' ' magic-space # [Space] - do history expansion
bindkey '^[[1;5C' forward-word # [Ctrl-RightArrow] - move forward one word
bindkey '^[[1;5D' backward-word # [Ctrl-LeftArrow] - move backward one word
if [[ "${terminfo[kcbt]}" != "" ]]; then
bindkey "${terminfo[kcbt]}" reverse-menu-complete # [Shift-Tab] - move through the completion menu backwards