I recently finally tried out Ack which I must say is a pretty awesome tool. The installation was fairly straight forward but I though that I would write it down here in case I’ll ever need to do it again or if someone wants a small guide with just a few easy steps.
- Download the standalone script from the here.
- Create a
batfile and add the following to it:
@"C:\path\to\perl.exe" C:\path\to\ack.pl %*. Change the paths so that they point to the relevant places.
- Save the file as
ack.batand place it somewhere in your system environment path, or create a new folder and add it to said path.1
- Last, but not least, create an alias for the
batfile in your
.bash_profileif you want to get it to work with Cygwin.
You can use the same steps to create a more “sophisticated” way of running any
kind of script too. Let’s say you have a script called
foo.rb. You want to run
it straight from the command line but you don’t necessary want to turn into
a full fledged gem. Just change the the first path in the
bat file so it
points to your binary Ruby file and the second to
your actually script and you’re all good!
Which can be modified under “System Properties” → “Advanced system settings” → “Advanced” → “Environment Variables” → “Path”. ↩