[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
an easier bash
Hi
After a discussion on 'dk.edb.unix' about GUI vs. CLI, I was inspired to
make bash a little easier for beginners with a lot more commands in both
danish and english. Basically it's a lot of aliases like eg.:
alias remove='rm -ir'
alias rename='mv -i'
alias rename='mv -i''
etc etc
Then I was told that SuSe already has this feature, it's only Redhat
that's lacking behind. I think Independence should have this feature
too. I've made some files that you copy on top of bash with a script for
easy administration:
-------------------
This is the Install script:
#! bin/sh
cat hushrc>>/etc/bashrc
mkdir /usr/lib/hush
cp README /usr/lib/hush/
mkdir /usr/lib/hush/en
cp aliases_en /usr/lib/hush/en/aliases
mkdir /usr/lib/hush/da
cp aliases_da /usr/lib/hush/da/aliases
--------
This is hushrc:
# hush = human(e) shell (extension to bash)
# this is appended to /etc/bashrc or ~/.bashrc
# to make life easier for the absolute beginner
# some nice shorthand aliases
alias x=startx
alias cp='cp -i'
alias mv='mv -i'
alias rr='rm -r'
alias ls='ls -F --color=auto'
alias la='ls -a'
alias ll='ls -l'
alias lt='ls -tr'
alias dir='ls -ba'
alias dot='ls .[a-zA-Z0-9_]*'
alias hid='ls .[a-zA-Z0-9_]*'
alias c=clear
alias m=less
alias j=jobs
alias more=less
alias edit='pico -w'
alias stop=exit
alias print='lpr'
alias mem='free'
alias memory='free'
# some nice functions
# compatability
function setenv()
{
if [ $# -ne 2 ] ; then
echo "setenv: Too few arguments"
else
export $1="$2"
fi
}
# rot13 decoding
rot13()
{
if [ $# = 0 ] ; then
tr "[a-m][n-z][A-M][N-Z]" "[n-z][a-m][N-Z][A-M]"
else
tr "[a-m][n-z][A-M][N-Z]" "[n-z][a-m][N-Z][A-M]" < $1
fi
}
# common misspellings for ppl with fat fingers :-)
alias mroe=more
alias pdw=pwd
alias loacte=locate
# and now for locale
if [ -f /usr/lib/hush/$LANG/aliases ] ; then
. /usr/lib/hush/$LANG/aliases
fi
-------------
This is an example of /usr/lib/hush/en/aliases:
# This should be /usr/lib/hush/en/aliases
# hush = human(e) shell -english
alias remove='rm -ri'
alias delete='rm -ri'
alias erase='rm -ri'
alias copy='cp -ai'
alias move='mv -i'
alias rename='mv -i'
alias list='ls -s'
alias list-long='ls -l'
alias list-all='ls -la'
alias list-hidden='ls .[a-zA-Z0-9_]*'
alias check='ls -s'
alias check-long='ls -l'
alias check-all='ls -la'
alias check-hidden='ls .[a-zA-Z0-9_]*'
alias contents='ls -s'
etc etc
--------
If you think it's a good idea, you can include it in the Independence
distro and I'll help maintain it. You can downloade the whole tarball
from my webpage:
http://members.xoom.com/langkjer/hush.tar.gz
Best regards
--
Birger Langkjer
http://members.xoom.com/langkjer/