User:Kkalder
From ICO wiki
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