Mercurial > hg > config
comparison .bashrc @ 310:a6cd6900419e
whview and whemacs use realwhich
| author | Jeff Hammel <jhammel@mozilla.com> | 
|---|---|
| date | Fri, 17 May 2013 02:31:37 -0700 | 
| parents | 6095d439d1f2 | 
| children | 11a349035020 | 
   comparison
  equal
  deleted
  inserted
  replaced
| 309:6095d439d1f2 | 310:a6cd6900419e | 
|---|---|
| 281 mv "$NEWNAME" "$2" | 281 mv "$NEWNAME" "$2" | 
| 282 } | 282 } | 
| 283 | 283 | 
| 284 ### `which` commands | 284 ### `which` commands | 
| 285 | 285 | 
| 286 whview() { | |
| 287 # which view | |
| 288 less `which $@` | |
| 289 } | |
| 290 | |
| 291 whemacs() { | |
| 292 # which emacs | |
| 293 emacs -nw `which $@` | |
| 294 } | |
| 295 | |
| 296 realwhich() { | 286 realwhich() { | 
| 297 # which -> real paths | 287 # which -> real paths | 
| 298 command which $@ | while read line | 288 command which $@ | while read line | 
| 299 do | 289 do | 
| 300 python -c "import os; print os.path.realpath('${line}')" | 290 python -c "import os; print os.path.realpath('${line}')" | 
| 301 done | 291 done | 
| 292 } | |
| 293 | |
| 294 whview() { | |
| 295 # which view | |
| 296 less `realwhich $@` | |
| 297 } | |
| 298 | |
| 299 whemacs() { | |
| 300 # which emacs | |
| 301 emacs -nw `realwhich $@` | |
| 302 } | 302 } | 
| 303 | 303 | 
| 304 ### functions for python | 304 ### functions for python | 
| 305 | 305 | 
| 306 pyfile() { | 306 pyfile() { | 
