Shellisms: Quickly edit any executable in your $PATH

I often find my self taking a look into the guts of commands I am executing. Instead of taking time digging around for the path, I wrote this little bash function to save me some time:

complete -c vipath # Auto-completes any executables in my $PATH
vipath () {
  FILE=`which $1`
  /usr/bin/env editor $FILE
}

Toss the above in your .bashrc, and you’re off.

vipath update-rc.d # Result: Open /usr/sbin/update-rc.d in your editor
Share and Enjoy:
  • StumbleUpon
  • Facebook
  • Twitter
  • Reddit
Shellisms: Quickly edit any executable in your $PATH

Leave a Reply

Your email address will not be published.