-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path.bashrc
More file actions
31 lines (27 loc) · 796 Bytes
/
.bashrc
File metadata and controls
31 lines (27 loc) · 796 Bytes
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
# Have history only save original lines, not duplicates
export HISTCONTROL=ignoreboth:erasedups
# User specific aliases and functions
alias hist='history | grep'
# At the cost of ugly results, make bc handle fp division by default
export BC_ENV_ARGS="${HOME}/.bc"
# countdown and stopwatch timers
function countdown()
{
if [ ! -z "$1" ]; then
date1=$((`date +%s` + $1));
while [ "$date1" -ge `date +%s` ]; do
echo -ne "$(date -u --date @$(($date1 - `date +%s`)) +%H:%M:%S)\r";
sleep 0.1
done
else
echo "Usage: countdown <seconds>"
fi
}
function stopwatch()
{
date1=`date +%s`;
while true; do
echo -ne "$(date -u --date @$((`date +%s` - $date1)) +%H:%M:%S)\r";
sleep 0.1
done
}