Sponsored Content
Top Forums Shell Programming and Scripting Need a perl script similiar to grep -r 'word' /path/to/dir" Post 302718845 by drl on Sunday 21st of October 2012 08:11:10 AM
Old 10-21-2012
Hi.

There is a grep work-alike written in perl at http://cpansearch.perl.org/src/CWEST...rc/grep/tcgrep It includes a recursive option.

Best wishes ... cheers, drl
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

grep all records in a file and get a word count -perl

Hi, I have a file .. file.txt .. i need to get a total record count in the files into a $variable.. im using perl script thanks (4 Replies)
Discussion started by: meghana
4 Replies

2. Shell Programming and Scripting

grep for "exact word"

Hi All, Very GM I am searching for a specific filesystem on a serevr, like df -k "/" i am geting an output also... but when i am checking for somthing like /oramnt (which is not mounted currently) so i am geting an out like this df -k "/oramnt" output of root...! so i tried... (7 Replies)
Discussion started by: bullz26
7 Replies

3. Shell Programming and Scripting

How do I define a particular dir in PATH variable and then unset that dir

How do I define a particular dir in front of PATH variable and then run some job and then at the end of job SET the PATH variable to original? in a script, WILL something like this work: ORIG_PATH=$PATH export PATH=/dir1/dir2:$PATH RUN SOME JOBS ..... unset PATH EXPORT... (2 Replies)
Discussion started by: Hangman2
2 Replies

4. AIX

rsh server "script..." which $PATH is used ?

When running a script on a distant server via rsh, what is the $PATH used ? I had done a script in the /usr/local/bin but the rsh reported it did not find it. So I assume it is using a separate $PATH but how can I find out ? (1 Reply)
Discussion started by: Browser_ice
1 Replies

5. Homework & Coursework Questions

How to use a execvp-call to do "grep PATH"?

Hello! I am learning how to use the function execvp. I have read through the UNIX manual. I have a process. I run execvp and I command it to do “printenv”. It works fine. Before I do the execvp-call I pipe STDOUT to go to a specific pipe. After that I restore STDOUT. I read that pipe in another... (2 Replies)
Discussion started by: andersbranderud
2 Replies

6. UNIX for Dummies Questions & Answers

How to check multi word in the same script for all dir ?

I want to check two different words are present in the same script and the words are, 1. message 2. 'error' - here {search word - including single quote} How to check in UNIX from current & sub directories or from root to all dir + sub directories ? Please advice. Thanks! (1 Reply)
Discussion started by: gkskumar
1 Replies

7. UNIX for Dummies Questions & Answers

grep for a last word from a path

Hi , I want to get the last word from a path. Example:: I have path:: /TEMP_REGRESSION/regression/TESTSUITE/TestCases/Test1201/ext_libs/DATA/INTERNAL/pad_ext.lef I want the last word only.ie pad_ext.lef Please let me know how to grep that word. Thanks in advance (6 Replies)
Discussion started by: gujrathinr
6 Replies

8. Shell Programming and Scripting

Finding a "word" through grep but display line above?

Hi guys. I am trying to perform a search using grep. I get my grep to work, but need to "awk" a Process Number that is 2 lines above... Example: I run a query on my TSM server for Processes that are "Waiting" for something...it returns this: Process Number: 32,881 Process... (14 Replies)
Discussion started by: Stephan
14 Replies

9. UNIX for Dummies Questions & Answers

Script to search for a particular word in files and print the word and path name

Hi, i am new to unix shell scripting and i need a script which would search for a particular word in all the files present in a directory. The output should have the word and file path name. For example: "word" "path name". Thanks for the reply in adv,:) (3 Replies)
Discussion started by: virtual_45
3 Replies

10. Shell Programming and Scripting

"find . -printf" without prepended "." path? Getting path to current working directory?

If I enter (simplified): find . -printf "%p\n" then all files in the output are prepended by a "." like ./local/share/test23.log How can achieve that a.) the leading "./" is omitted and/or b.) the full path to the current directory is inserted (enclosed by brackets and a blank)... (1 Reply)
Discussion started by: pstein
1 Replies
ZGREP(1)                                                      General Commands Manual                                                     ZGREP(1)

NAME
zgrep - search possibly compressed files for a regular expression SYNOPSIS
zgrep [ grep_options ] [ -e ] pattern filename... DESCRIPTION
Zgrep invokes grep on compressed or gzipped files. These grep options will cause zgrep to terminate with an error code: (-[drRzZ]|--di*|--exc*|--inc*|--rec*|--nu*). All other options specified are passed directly to grep. If no file is specified, then the standard input is decompressed if necessary and fed to grep. Otherwise the given files are uncompressed if necessary and fed to grep. If the GREP environment variable is set, zgrep uses it as the grep program to be invoked. EXIT CODE
2 - An option that is not supported was specified. AUTHOR
Charles Levert (charles@comm.polymtl.ca) SEE ALSO
grep(1), gzexe(1), gzip(1), zdiff(1), zforce(1), zmore(1), znew(1) ZGREP(1)
All times are GMT -4. The time now is 03:22 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy