ack

How do I run programs with Strawberry Perl?

A coworker is trying to use ack (a Perl program) on his Windows machine, having tried it under Linux and decided he definitely wants to use it. He managed to get Strawberry Perl installed on his machine, but can't seem to figure out what to do to make ack run with it from a command prompt. He tried editing the #! line, but I knew that ...

Unable to make Firefox open Ack's output

I aim to have a list of lines where I use the word NB in my notes. Pseudo-code open -a Firefox `ack -a NB` However, I cannot make Firefox to understand parameters from terminal. The output of Ack is a text-file, so it should be somehow redirected to Firefox. I run unsuccessfully open "http://`ack -a NB`" I get in Firefox's addre...

How can I install and use ack library on Windows?

I have never used Perl, but I am really impressed by the ack, which I would like to use for source code searching, etc. Can anyone guide me of how to make use of this excellent library on Windows? ...

grep - search for "<?\n" at start of a file

I have a hunch that I should probably be using ack or egrep instead, but what should I use to basically look for <? at the start of a file? I'm trying to find all files that contain the php short open tag since I migrated a bunch of legacy scripts to a relatively new server with the latest php 5. I know the regex would probably be '/...

How can I find strings that have mixed cased with Perl?

I'm trying to filter thousands of files, looking for those which contain string constants with mixed case. Such strings can be embedded in whitespace, but may not contain whitespace themselves. So the following (containing UC chars) are matches: " AString " // leading and trailing spaces together allowed "AString " // trailing sp...

Where should I put the ack configuration file on Windows?

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? ...

how to truncate long matching lines returned by grep or ack

I want to run ack or grep on html files that often have very long lines. I don't want to see very long lines that wrap repeatedly. But I do want to see just that portion of a long line that surrounds a string that matches the regular expression. How can I get this using any combination of unix tools? ...

ack does not work when run from "grep-find" in Emacs on Windows

I'm trying to use ack-grep as a replacement for grep + find in Emacs on Windows, but ack-grep exits immediately (successfully) without printing any matches. I've tried just about every conceivable combination of command-line parameters to ack-grep, but nothing seems to work. M-x grep-find Enter "ack html" to search for files containin...

xargs not working

I want all the lines with assert_equal and without amazon. I tried following but it is not working. ack assert_equal | xargs ack -v amazon ...

Eclipse: Making Eclipse's "search in project" less unhelpful?

Eclipse's "find in project" took is, as far as I can tell, blindingly stupid. Let me illustrate. This is what I get when I run a "find in project": And when I click to see what's in that "closed" skinning folder I get... ... and so on. So how can I make this more helpful? Am I doing something wrong? Ideally, I'd like to see some...

elisp compile, add a regexp to error detection

I am starting with emacs, and don't know much elisp. Nearly nothing, really. I want to use ack as a replacement of grep. These are the instructions I followed to use ack from within emacs: http://www.rooijan.za.net/?q=ack_el Now I don't like the output format that is used in this el file, I would like the output to be that of ack --gr...

Why do I get extra, unexpected results with my ack regex?

I'm finally learning regexps and training with ack. I believe this uses Perl regexp. I want to match all lines where the first non-blank characters are if (<word> !, with any number of spaces in between the elements. This is what I came up with: ^[ \t]*if *\(\w+ *! It only nearly worked. ^[ \t]* is wrong, since it matches one or non...

ack: Excluding only one directory but keeping all others with the same name

My folder structure looks like this: /app /app/data ... /app/secondary /app/secondary/data I want to recursively search /app, including /app/data. I do not want to search /app/secondary/data however. This what I have so far: ack --ignore-dir=data searchtext ack --ignore-dir=secondary/data searchtext The first command is ignoring bo...

How to look for files not having the word TEST using ack

I love ack. I need to search for 'foo' in all the files except the test files. ack has option -G to specify regex. However I am not sure how do I write regex for the condition that look for all files but ignore files with word 'test'. ...

ack misses results (vs. grep)

I'm sure I'm misunderstanding something about ack's file/directory ignore defaults, but perhaps somebody could shed some light on this for me: mbuck$ grep logout -R app/views/ Binary file app/views/shared/._header.html.erb.bak.swp matches Binary file app/views/shared/._header.html.erb.swp matches app/views/shared/_header.html.erb.bak: <...

ack-grep: please help with chars escaping

My goal is to find all "<?=" occurrences with ack. How can I do that? ack "<?=" Doesn't work. Please tell me how can I fix escaping here? ...

How to wait until your TCP message has been ACKed

Background: We have a client/server application that uses a persistent connection to the server. Benchmarks show that it is many times faster to use an already open connection rather than spend significant time (2.5 seconds) setting up a new connection (crypto). Unfortunately, the old connection may be stale. Is there a way to wait f...

How to let ack support more filetypes?

in ack's home page, there lists a lot of file type, but without aspx, is it possible to let ack support it? ...