-
Notifications
You must be signed in to change notification settings - Fork 0
/
.bashrc
45 lines (41 loc) · 1.02 KB
/
.bashrc
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
#
# ~/.bashrc
#
# If not running interactively, don't do anything
[[ $- != *i* ]] && return
eval "`dircolors ~/.dircolors`"
alias ls='ls --color=auto'
PS1='[\u@\h \W]\$ '
# build and run code
build () {
case $1 in
*.cpp)
output=${1%".cpp"}
g++ $1 -o $output && ./$output
echo
rm $output;;
*.c)
output=${1%".c"}
gcc $1 -o $output && ./$output
echo
rm $output;;
*.py)
python -u ./$1;;
*.java)
classpath="../"
if [ $# -eq 2 ]; then
classpath=$2
fi
javac -cp $classpath -d $classpath $1 && java -cp $classpath $1
rm -f *.class
echo;;
*.rs)
output=${1%".rs"}
rustc $1 && ./$output
echo
rm $output;;
esac
}
# Use bash-completion, if available
[[ $PS1 && -f /usr/share/bash-completion/bash_completion ]] && \
. /usr/share/bash-completion/bash_completion