comparison .bash_aliases @ 125:28c2ddd02e8f

Replace hgs alias with function
author Steve Huston <huston@astro.princeton.edu>
date Wed, 14 Jan 2015 16:00:03 -0500
parents 3f720fcb9710
children 4b397e94691a
comparison
equal deleted inserted replaced
124:3f720fcb9710 125:28c2ddd02e8f
89 89
90 # Programs 90 # Programs
91 alias atari='atari800 -height 800 -width 600' 91 alias atari='atari800 -height 800 -width 600'
92 alias base64='openssl enc -a' 92 alias base64='openssl enc -a'
93 alias bsr='bigscreen -raAx' 93 alias bsr='bigscreen -raAx'
94 alias hgs="hg serve -a localhost -p 0 & sleep 1 ; open http://\`lsof -p \$! | grep LISTEN | awk '{print \$9}'\`/ ; fg"
95 alias irssi-test='irssi --home=$HOME/irssi-test/' 94 alias irssi-test='irssi --home=$HOME/irssi-test/'
96 alias jt65='wine /Users/huston/.wine/drive_c/Program\ Files/jt65hf109/jt65-hf.exe' 95 alias jt65='wine /Users/huston/.wine/drive_c/Program\ Files/jt65hf109/jt65-hf.exe'
97 alias pine='alpine' 96 alias pine='alpine'
98 alias ret='screen -raAx' 97 alias ret='screen -raAx'
99 alias rot13="tr 'a-zA-Z' 'n-za-mN-ZA-M'" 98 alias rot13="tr 'a-zA-Z' 'n-za-mN-ZA-M'"
245 vim -e +TOhtml "+w ${OUTDIR}/${OUT}.html" +qa\! $F 244 vim -e +TOhtml "+w ${OUTDIR}/${OUT}.html" +qa\! $F
246 done 245 done
247 echo Files stored in $OUTDIR 246 echo Files stored in $OUTDIR
248 } 247 }
249 248
249 hgs() {
250 # Currently works on Macs, I should write a version for Linux as well
251 # someday
252 if [ "$1" == "end" -a -e .hgserve-PID ] ; then
253 kill `cat .hgserve-PID`
254 rm .hgserve-PID
255 elif [ -e .hgserve-PID ] ; then
256 P=`cat .hgserve-PID`
257 URL=`lsof -p $P | grep LISTEN | awk '{print $9}'`
258 open http://$URL/
259 else
260 hg serve -a localhost -d -p 0 --pid-file .hgserve-PID | sed 's#.*bound to \(.*\))#http://\1/#' | xargs open
261 fi
262 }
263
250 # vim: set filetype=sh : 264 # vim: set filetype=sh :