diff .bashrc @ 309:6095d439d1f2

new stuff! realwhich
author Jeff Hammel <jhammel@mozilla.com>
date Thu, 16 May 2013 23:27:18 -0700
parents fac01a1bcedf
children a6cd6900419e
line wrap: on
line diff
--- a/.bashrc	Thu May 16 16:05:52 2013 -0700
+++ b/.bashrc	Thu May 16 23:27:18 2013 -0700
@@ -281,6 +281,7 @@
     mv "$NEWNAME" "$2"
 }
 
+### `which` commands
 
 whview() {
     # which view
@@ -292,6 +293,14 @@
     emacs -nw `which $@`
 }
 
+realwhich() {
+    # which -> real paths
+    command which $@ | while read line
+    do
+        python -c "import os; print os.path.realpath('${line}')"
+    done
+}
+
 ### functions for python
 
 pyfile() {