1

when I ack something I often get output like this:

Ack: tmp/nonces/4e8c9698-https-www.google.com-kkEIoIiSEjUBRD.lRR_tT9V6ccE-mRPtTixYnWzzGcPpbIwx9scpDnE: Permission denied
Ack: tmp/nonces/4e8cbba9-https-www.google.com-kkEIoIiSEjUBRD.lRR_tT9V6ccE-oARiyZ2BwCEskqiPzrfQd1FI_fI: Permission denied
Ack: tmp/nonces/4e8d0b16-https-www.google.com-kkEIoIiSEjUBRD.lRR_tT9V6ccE-M8ARATBrrCt8Dzx_AUVyqQPlesE: Permission denied
Ack: tmp/nonces/4e8df921-https-www.google.com-kkEIoIiSEjUBRD.lRR_tT9V6ccE-qOogYRrIy2P4eFSD0dps0axw41k: Permission denied
Ack: tmp/nonces/4e8f25a5-https-www.google.com-kkEIoIiSEjUBRD.lRR_tT9V6ccE-.gfEmcarFxfuir1JeQeKjevK4Js: Permission denied
Ack: tmp/nonces/4e8f66ac-https-www.google.com-kkEIoIiSEjUBRD.lRR_tT9V6ccE-A_iNHhXoUELEWtENxyYp8H_HsJA: Permission denied
Ack: tmp/nonces/4e8f6ad6-https-www.google.com-kkEIoIiSEjUBRD.lRR_tT9V6ccE-xISGU82nDE6h.hGAKD7t8kfP3f0: Permission denied
Ack: tmp/nonces/4e8f6c43-https-www.google.com-kkEIoIiSEjUBRD.lRR_tT9V6ccE-8_4stPggeXhICZbspC7n3JPbbwU: Permission denied
Ack: tmp/nonces/4e9021f8-https-www.google.com-kkEIoIiSEjUBRD.lRR_tT9V6ccE-4LlZ.TfExXsf3L2woyFw9.LJF1U: Permission denied
Ack: tmp/nonces/4e90964d-https-www.google.com-kkEIoIiSEjUBRD.lRR_tT9V6ccE-MQcsEojzduPoDsosj.gnN5jPrmQ: Permission denied

What is this and how can I fix it/make it go away?

EDIT: this only happens in the MacVim output when I use the Ack plugin. Normal Ack does not do this.

butterywombat
  • 2,069
  • 7
  • 26
  • 44

1 Answers1

3

The /tmp directory is going to be used by users other than you , and you won't have permission to read those files or directories (even if you're the only one using the machine, various root processes will still use the /tmp dir). There doesn't seem to be an ack option to not complain about permission problems, so you just have to discard those lines. An easy way is to just throw out everything ack prints to stderr, like so:

alias ack='ack $* 2> /dev/null'

However, that will discard all ack errors. To just discard the "Permission denied" errors requires a bit more work. Assuming you're using bash as your shell, put this into your ~/.bash_aliases file:

function ack_discard_perm_errs()
{
    \ack --color $* 2>&1 | grep -v "Permission denied"
}

alias ack='ack_discard_perm_errs $*'
Matthew Cline
  • 2,312
  • 1
  • 19
  • 36
  • 1
    hmm..I added this to my bash profile (is that the same thing? I don't know much about bash) and it didn't do anything. I should have clarified that I don't get any errors if I do it from command line, only when I use the Ack plugin for macvim. – butterywombat Jan 16 '12 at 14:25