Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

2
  • 2
    That's a lot of work...here's the use case: When running tests, I want to alias rspec-all to run certain tests. But which tests depends on the project. And that is determined by the directory.
    – B Seven
    Commented Oct 27, 2012 at 3:11
  • 2
    What I can see, you have two options, either use one function (like @Bernhard described above), and branch depending on directory (just like he said), or, you could put the parameters in the directories. Come to think of it, it doesn't have to be scripts, you could just put a file (touch .TESTNO; echo 2 > .TESTNO) in each directory, and then, in your function, look for that file, and branch according to what test number the .TESTNO file contains. Although not at all difficult, you probably cannot use an alias for this; you must use a function. Commented Oct 27, 2012 at 5:17