Sie sind auf Seite 1von 3

# Source global definitions

if [ -f /etc/bashrc ]; then
. /etc/bashrc
fi
# Turn on extended pattern matching:
shopt -s extglob
# Turns off "intelligent" Bash auto-completion (restores normal auto-completion)
:
# # complete -r
# Turns off '!' history expansion:
set +H
# Useful aliases:
alias awk='gawk --lint --re-interval' # Options for gawk
alias big='figlet -tcW -f banner'
alias ..='cd ..'
alias cd..='cd ..'
alias cls=clear
alias cr='chmod a+r'
alias cx='chmod a+x'
alias csc=gmcs # mono C# compiler
alias df='df -h'
alias doh="play -q ~wpollock/sounds/Doh1.au"
alias du='du -h'
alias f=finger
alias h='history 50'
alias l='ls -lh'
alias la='ls -aF'
alias li='ls -lhi'
alias ls='ls -F'
alias lsblk='lsblk -o NAME,GROUP,SIZE,MOUNTPOINT'
alias lslocks='lslocks -o +BLOCKER'
alias mail=nail
alias mc='echo ERROR with mc '
alias mess='tail -35 /var/log/messages'
alias myntpdate='ntpdate -q 0.us.pool.ntp.org'
alias nslookup='nslookup -sil'
alias nonascii='LC_ALL=C grep "[^[:print:]]"'
alias p7zip=7za
alias path='echo PATH=$PATH'
alias ping='ping -v'
alias pps='ps w -cfA'
alias ppwd=/bin/pwd
alias pri='cd ~/private'
alias quota='quota -vs'
alias rehash='hash -r'
alias rm='rm -i'
alias rrm='rm -rf'
#alias rs='set noglob; eval $(resize)'
alias su='LEVEL=0 su'
alias showtemp="nc localhost 7634 | sed -e 's,|/dev/,\n&,g'; echo"
alias vi=vim
alias whereis='command -v'
alias ybsync='rsync -HavAXuz --include=/.bashrc --include=/.vim/*** --include=/.
bash_profile --exclude=/.* --exclude=/tmp/*** --exclude=/private/journal --exclu
de=secret.txt yborstudent.hccfl.edu:./ --exclude=/mail/*** ~'

if test $(id -u) -eq 0


then
alias cp='cp -i'
alias mv='mv -i'
PCHAR='#'
else
PCHAR='$'
fi
# Define shell functions:
lsc() { /bin/ls -FC $* | more; }
#calc() { IFS= printf 'scale=4; %s\n' "$*" | bc -l; }
calc() { IFS= read -r -p 'Expression: ' EXPR;
printf 'scale=4; %s\n' "$EXPR" | bc -l;
}
ip2bin()
{
NUMS=$(printf '%s\n' "$@" | sed -e 's/[^[:digit:]]/\n/g')
printf 'obase=2\nibase=10\n%s\n' "$NUMS" | bc -l \
| sed -e 's/^/0000000/' -e 's/.*\(.\{8\}\)/\1/' \
| xargs printf '%s '
echo
}
cmd() { apropos "$@" | egrep '\((1|8)' | less; }
lt() { /bin/ls -lt "$@" | head; }
man2text() { zcat -f $(man -w -- "$1") |groff -Tascii -mandoc; }
rand() { echo $(dd if=/dev/urandom bs=1 count=4 2>/dev/null | od -An -tu4); }
textfiles() { file ${*:-*} | grep text | sed 's/:.*//'; }
dec2hex() { if test "$1" -lt 0
then printf -- '-0x%X\n' $((-$1))
else printf '0x%X\n' "$1"
fi
}
dec2bin()
hex2dec()
hex2bin()
bin2hex()
bin2dec()

{
{
{
{
{

echo "obase=2; ibase=10; $1" |bc; }


num=$(echo "$1" |tr a-z A-Z); echo "obase=10; ibase=16; $num" |bc; }
num=$(echo "$1" |tr a-z A-Z); echo "obase=2; ibase=16; $num" |bc; }
echo "obase=16; ibase=2; $1" |bc; }
echo "obase=10; ibase=2; $1" |bc; }

# The chr function converts a number to the equivalent ASCII character:


chr() { printf '%s\n' "$@" | awk '{printf("%c",$0);}'; }
# A substring test: Return sucess if $2 is a substring of $1 (see
# /etc/init.d/functions on Red Hat systems before 2011 and look at strstr):
substring() { [ "${1#*$2*}" != "$1" ]; }
# Set the Prompt:
# Setting PROMPT_COMMAND this way will set the window title (and icon text):
if ! expr "$(tty)" : "/dev/tty.$" >/dev/null; then
PROMPT_COMMAND='printf "\e]0;$(id -nu)@$(hostname -f): $PWD\a"'
else

PROMPT_COMMAND=
fi
# LEVEL should be set to zero and exported in login script first:
let 'LEVEL = LEVEL + 1'
# If LEVEL is 1 this is a "root" (top-level) window. If not 1,
# this may be a root window if using X, since that fires up xterm
# as a non-login shell. But in that case SHLVL > LEVEL. Tricky!
if [ "$LEVEL" -eq 1 -o "${SHLVL-0}" -ne "$LEVEL" ]
then
PS1='\n\[$(tput bold)\]\u@\h\[$(tput sgr0)\] $PWD\n$PCHAR '
SHLVL=1
LEVEL=1
[ "$PCHAR" = "$" ] && set -o ignoreeof
else
PS1='\n\[$(tput bold)\]\u@\h\[$(tput sgr0)\] ($LEVEL) $PWD\n$PCHAR '
fi
mydf() {
\df -hT --sync | \
awk '
NR == 1 { title = $0; next }
{ row[$7] = $0 }
END
{ print title
for (fs in row) print row[fs] | "sort -k7"
close("sort -k7")
}
'
}
export PERL_LOCAL_LIB_ROOT="/home/wpollock/perl5";
export PERL_MB_OPT="--install_base /home/wpollock/perl5";
export PERL_MM_OPT="INSTALL_BASE=/home/wpollock/perl5";
export PERL5LIB="/home/wpollock/perl5/lib/perl5/i386-linux-thread-multi:/home/wp
ollock/perl5/lib/perl5";
export PATH="/home/wpollock/perl5/bin:$PATH";

Das könnte Ihnen auch gefallen