User:Kkalder: Difference between revisions
From ICO wiki
Jump to navigationJump to search
Created page with '#!/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 kirjutata…' |
No edit summary |
||
Line 1: | Line 1: | ||
<source lang="bash"> | |||
#!/bin/bash | #!/bin/bash | ||
#Autor: Kristjan Kalder; jolinar@jolinar.pri.ee | #Autor: Kristjan Kalder; jolinar@jolinar.pri.ee | ||
Line 17: | Line 19: | ||
echo "Resourcing" | echo "Resourcing" | ||
/bin/bash --rcfile $HOME/.bashrc | /bin/bash --rcfile $HOME/.bashrc | ||
</source> |
Latest revision as of 11:26, 10 May 2011
#!/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