User:Kkalder

From ICO wiki
Revision as of 11:26, 10 May 2011 by Kkalder (talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigationJump to search
#!/bin/bash
#Autor: Kristjan Kalder; jolinar@jolinar.pri.ee
#Versioon: 0.5b
#Kontrollime kas bashrc on kirjutatav
if [ ! -w ~/.bashrc ];
then
    echo "bashrc fail pole kirjutatav"
fi
#kontrollime kas argumendid on õiged
if [ -z "$1" ] || [ -z "$2" ];
then
    echo "Kasutamine: $(basename $0) alias "mille alias""
    exit 1
fi
echo "Lisame aliase: $1='$2'"
echo "alias $1='$2'" >> $HOME/.bashrc
echo "Resourcing"
/bin/bash --rcfile $HOME/.bashrc