4

I'm using ack (the grep replacement) on Windows XP under Strawberry Perl. Where should the .ackrc config file be placed, since ~/.ackrc is not reasonable on Windows?

brian d foy
  • 129,424
  • 31
  • 207
  • 592
Jeremy Dunck
  • 5,724
  • 6
  • 25
  • 30

3 Answers3

6

For windows (MSWin32, anyway), ack looks in the following places and uses the first file found:

$ENV{ACKRC}
$ENV{HOME}/.ackrc
$ENV{HOME}/_ackrc
$ENV{USERPROFILE}/.ackrc
$ENV{USERPROFILE}/_ackrc

All but the first are subject to glob-expansion, so watch out for meta-characters in your environment variables.

When not on windows, HOME and USERPROFILE are replaced by ~ and HOME, respectively.

ysth
  • 96,171
  • 6
  • 121
  • 214
5

ack looks for either .ackrc or _ackrc under %HOME% or %USERPROFILE%.

jamessan
  • 41,569
  • 8
  • 85
  • 85
5

The ack docs answer your question. Always check the docs. :)

Ahmad Baktash Hayeri
  • 5,802
  • 4
  • 30
  • 43
brian d foy
  • 129,424
  • 31
  • 207
  • 592