Sponsored Content
Top Forums Shell Programming and Scripting Looking for command(s)/ script to find a text string within a file Post 302097234 by wrwelden on Wednesday 22nd of November 2006 11:19:13 AM
Old 11-22-2006
Thanks to both of you

These examples helped. Thank you.

I do not use shell scripting much. Now I can learn from these results.

The results were :

Code:
devr> find . -name '*.*' -exec grep -ilw 'MAXCOMB' {} \;
./IPY0115.prog
./IPY0130.pl
./condir_and_copy_daily.sh
./IPY0130_old.pl
devr> find . -name '*.*' -exec grep -ilw 'maxcomb' {} \;
./IPY0115.prog
./IPY0130.pl
./condir_and_copy_daily.sh
./IPY0130_old.pl
devr> 
devr> | xargs grep -il 'maxcomb' {} \;                      <
grep: can't open {}
grep: can't open ;
grep: can't open {}
grep: can't open ;
./IPY0115.prog
grep: can't open {}
grep: can't open ;
grep: can't open {}
grep: can't open ;
grep: can't open {}
grep: can't open ;
grep: can't open {}
grep: can't open ;
grep: can't open {}
grep: can't open ;
grep: can't open {}
grep: can't open ;
./IPY0130.pl
grep: can't open {}
grep: can't open ;
grep: can't open {}
grep: can't open ;
./test_file_shell.sh
grep: can't open {}
grep: can't open ;
./dir_copy_daily_files.sh
./dir_copy_biweekly_files.sh
./condir_and_copy_biweekly.sh
./condir_and_copy_daily.sh
grep: can't open {}
grep: can't open ;
grep: can't open {}
grep: can't open ;
./doi_dnld_files.prog
./IPY0130_old.pl
grep: can't open ./View
grep: can't open for
grep: can't open value_set
grep: can't open Role_id.sql
devr> rgs grep -il 'maxcomb'                                <
./IPY0115.prog
./IPY0130.pl
./test_file_shell.sh
./dir_copy_daily_files.sh
./dir_copy_biweekly_files.sh
./condir_and_copy_biweekly.sh
./condir_and_copy_daily.sh
./doi_dnld_files.prog
./IPY0130_old.pl
grep: can't open ./View
grep: can't open for
grep: can't open value_set
grep: can't open Role_id.sql
devr> find . -name '*.*' -print | xargs grep -ilw 'maxcomb'
./IPY0115.prog
./IPY0130.pl
./condir_and_copy_daily.sh
./IPY0130_old.pl
grep: can't open ./View
grep: can't open for
grep: can't open value_set
grep: can't open Role_id.sql

 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

find a string in a file and add some text after that file

Hi Could you please help me out by solving teh below problem ? I have a file with as below source1|target1|yes source2|target2|no source1 is file in which i have to place some code under the <head> tag in it. What code i have to place in source1 is something like this "abcd.....<target1>... (5 Replies)
Discussion started by: Tasha_T
5 Replies

2. Shell Programming and Scripting

How to redirect a input of find command into a text file

Hello friends, I want a command to print the reult files from find command into a text file.:) Iam looking from forum memebers. PLZ help me.ASAP Thanks in Advance, Siva Ranganath CH (5 Replies)
Discussion started by: sivaranga001
5 Replies

3. Shell Programming and Scripting

Find string in text file

Hello! Please, help me to write such script. I have some text file with name filename.txt I must check if this file contains string "test-string-first", I must cut from this file string which follows string "keyword-string:" and till first white-space and save it to some variable. For... (3 Replies)
Discussion started by: optik77
3 Replies

4. Shell Programming and Scripting

find string(s) in text file and nearby data, export to list help

Hi, So I'm kinda new to shell scripts and the like. I've picked up quite a bit of use from browsing the forums here but ran into a new one that I can't seem to find an answer for. I'm looking to parse/find a string AND the next 15 or so charachters that follow the string within a text file... (1 Reply)
Discussion started by: kar23me
1 Replies

5. Shell Programming and Scripting

Find multiple string in one file using find command

Hi, I want find multiple string in one file using find coomand. And keeping it in one variable.grep is not working. (5 Replies)
Discussion started by: vivek1489
5 Replies

6. Shell Programming and Scripting

How to find repeated string in a text file

I have a text file where I need to find the string = ST*850* This string is repetaed several times in the file, so I need to know how many times it appears in the file, this is the text files: ISA*00* *00* *08*925485USNR *ZZ*IMSALADDERSP... (13 Replies)
Discussion started by: cucosss
13 Replies

7. UNIX for Dummies Questions & Answers

How to pass file text into find command

Hi all, I have a large text file and also a smaller list of program names. I want to find out how many of those programs exist in the large text file. Can someone help me with the command/script please. The program list is along the lines of tranwe2 tranwe3 tranye5 etc so basically I... (5 Replies)
Discussion started by: Grueben
5 Replies

8. Shell Programming and Scripting

[Need help] perl script to find the occurance of string from a text file

I have two files 1. input.txt 2. keyword.txt input.txt has contents like .src_ref 0 "call.s" 24 first 0x000000 0x5a80 0x0060 BRA.l 0x60 .src_ref 0 "call.s" 30 first 0x000002 0x1bc5 RETI .src_ref 0 "call.s" 31 first 0x000003 0x6840 ... (2 Replies)
Discussion started by: acdc
2 Replies

9. UNIX for Beginners Questions & Answers

Find and replace a string in a text file

Dear all, I want to find all the "," in my text file and then replace the commas to a tab. I found a script online but I don't know how to modify the script for my case. Any one can help? Thank you. @echo off &setlocal set "search=%1" set "replace=%2" set "textfile=Input.txt" set... (2 Replies)
Discussion started by: forevertl
2 Replies

10. Shell Programming and Scripting

How can I use find command to search string/pattern in a file recursively?

Hi, How can I use find command to search string/pattern in a file recursively? What I tried: find . -type f -exec cat {} | grep "make" \; Output: grep: find: ;: No such file or directory missing argument to `-exec' And this: find . -type f -exec cat {} \; -exec grep "make" {} \;... (12 Replies)
Discussion started by: cola
12 Replies
uudemon(4)						     Kernel Interfaces Manual							uudemon(4)

NAME
uudemon.admin, uudemon.cleanu, uudemon.hour, uudemon.poll - Administrative shell scripts for polling remote systems, cleaning up spool directories, reporting status to the system administrator, and routine invocations of the uuxqt and uusched daemons SYNOPSIS
These shell scripts reside in the following directory: /usr/lib/uucp DESCRIPTION
All the scripts can be run from the command line or can be run automatically by the cron daemon. To automatically run the scripts, remove the comment character (#) from the beginning of the relevant line in the /var/spool/cron/crontabs/uucp file. This script reports status to the system administrator. It issues the uustat command to find out the status of uucp jobs. It mails the results to the uucp login ID. The script may be modified to send mail to any login ID such as the uucp administrative login ID (uucpa) or root. This script cleans up the /var/spool/uucp and /var/spool/uucppublic directories by running the uucleanup command. The uucleanup com- mand is run with the following parameters: -C7, -D7, X2, -o2, -W1. This script runs the uusched and uuxqt daemons in the background. This script polls the systems listed in the /usr/lib/uucp/Poll file. The uudemon.poll script should be scheduled before the uudemon.hour script. This allows uudemon.poll to create any command files before cron runs the uudemon.hour script. FILES
Contains the uudemon.admin, uudemon.cleanu, uudemon.hour and uudemon.poll files. Contains the uucp file. RELATED INFORMATION
Commands: cron(8), uucleanup(8), uusched(8), uuxqt(1) Files: /usr/lib/uucp delim off uudemon(4)
All times are GMT -4. The time now is 04:06 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy