Skip to main content
Tweeted twitter.com/#!/StackUnix/status/262027473414389760
edited tags
Link
Gilles 'SO- stop being evil'
  • 838.7k
  • 198
  • 1.8k
  • 2.2k
Source Link
B Seven
  • 8.1k
  • 7
  • 24
  • 20

How to set an alias on a per-directory basis?

Suppose you have an alias go, but want it to do different things in different directories?

In one directory it should run cmd1, but in another directory it should run cmd2

By the way, I have an aliases for switching to the above directories already, so is it possible to append the go alias assignment to the foo alias?

alias "foo=cd /path/to/foo"

Working in bash(?) on OSX.