Puppy Linux Discussion Forum Forum Index Puppy Linux Discussion Forum
Puppy HOME page : puppylinux.com
"THE" alternative forum : puppylinux.info
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

The time now is Sun 26 Oct 2014, 05:29
All times are UTC - 4
 Forum index » Advanced Topics » Additional Software (PETs, n' stuff) » Utilities
ack from betterthangrep.com
Post_new_topic   Reply_to_topic View_previous_topic :: View_next_topic
Page 1 of 1 Posts_count  
Author Message
mcewanw

Joined: 16 Aug 2007
Posts: 2346
Location: New Zealand

PostPosted: Mon 24 Jan 2011, 18:46    Post_subject:  ack from betterthangrep.com
Sub_title: can often easily replace complex grep, find, sed, awk one-liners
 

dotpet of ack

Version: 1.94

May run on most Puppy's. Doesn't need devx sfs loaded.

Its a simple Perl script which just uses core perl and hence runs on standard Puppy (I tested it on Wary 5). Way easier to use than grep most of the time. A simple pattern search can often be used instead of a complex piped combination of grep, find, sed and/or awk.

Turned off colour by specifying --nocolour in the ~/.ackrc file because otherwise ack complains it can't open ANSI color Terminal.

Note that
Code:
ack --help
doesn't work but you can read the help at the ack website homepage, or simply open the /bin/ack perl script in any text editor and the usage help is near the top.

From the http://betterthangrep.com/ website:

Top 10 reasons to use ack instead of grep.
Quote:

1. It's blazingly fast because it only searches the stuff you want searched.
2. ack is pure Perl, so it runs on Windows just fine.
3. The standalone version uses no non-standard modules, so you can put it in your ~/bin without fear.
4. Searches recursively through directories by default, while ignoring .svn, CVS and other VCS directories.
* Which would you rather type?
$ grep pattern $(find . -type f | grep -v '\.svn')
$ ack pattern
5. ack ignores most of the crap you don't want to search
* VCS directories
* blib, the Perl build directory
* backup files like foo~ and #foo#
* binary files, core dumps, etc
6. Ignoring .svn directories means that ack is faster than grep for searching through trees.
7. Lets you specify file types to search, as in --perl or --nohtml.
* Which would you rather type?
$ grep pattern $(find . -name '*.pl' -or -name '*.pm' -or -name '*.pod' | grep -v .svn)
$ ack --perl pattern
Note that ack's --perl also checks the shebang lines of files without suffixes, which the find command will not.
8. File-filtering capabilities usable without searching with ack -f. This lets you create lists of files of a given type.
$ ack -f --perl > all-perl-files
9. Color highlighting of search results.
10. Uses real Perl regular expressions, not a GNU subset.
11. Allows you to specify output using Perl's special variables
* Example: ack '(Mr|Mr?s)\. (Smith|Jones)' --output='$&'
12. Many command-line switches are the same as in GNU grep:
-w does word-only searching
-c shows counts per file of matches
-l gives the filename instead of matching lines
etc.
13. Command name is 25% fewer characters to type! Save days of free-time! Heck, it's 50% shorter compared to grep -r.
ack-1.94.pet
Description 
pet

 Download 
Filename  ack-1.94.pet 
Filesize  24.38 KB 
Downloaded  268 Time(s) 

_________________
Non enim propter gloriam, diuicias aut honores pugnamus set propter libertatem solummodo quam Nemo bonus nisi simul cum vita amittit.
Back to top
View user's profile Send_private_message Visit_website 
Geoffrey


Joined: 30 May 2010
Posts: 1437
Location: Queensland Australia ɹǝpu∩uʍop

PostPosted: Tue 25 Jan 2011, 17:53    Post_subject:  

Cool, another weapon for the arsenal, by the way, " ack --help " works for me.
Back to top
View user's profile Send_private_message 
Display_posts:   Sort by:   
Page 1 of 1 Posts_count  
Post_new_topic   Reply_to_topic View_previous_topic :: View_next_topic
 Forum index » Advanced Topics » Additional Software (PETs, n' stuff) » Utilities
Jump to:  

Rules_post_cannot
Rules_reply_cannot
Rules_edit_cannot
Rules_delete_cannot
Rules_vote_cannot
You cannot attach files in this forum
You can download files in this forum


Powered by phpBB © 2001, 2005 phpBB Group
[ Time: 0.0854s ][ Queries: 12 (0.0434s) ][ GZIP on ]