Sponsored Content
Top Forums Shell Programming and Scripting How to recursively search for a list of keywords in a given directory? Post 302640613 by neelmani on Tuesday 15th of May 2012 06:27:03 AM
Old 05-15-2012
@glev2005 not working i am getting same error as :fgrep: illegal option -- R
actually the r option is not there in fgrep.. any other way??
 

9 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Search and replace words between two keywords

Hi, I have a file which contains the following : select * from test where test_id=1; select id from test1, test2 where test_id=1 and test_id=2; select * from test1, test2, test3 where test_id=4 and test2_id where in (select test2_id from test2); select id1, id2 from test ... (6 Replies)
Discussion started by: vrrajeeb
6 Replies

2. Shell Programming and Scripting

How to search for keywords in subsequent lines

Hi all, I am looking for a coomand to search for the keywords in susequenct lines. Keyword1 in a line and Keyword2 in the very next line. Once i found the combination ineed to print the lines with patterns and the line above and one below. I am giving an example here: Keywords are :ERROR and... (12 Replies)
Discussion started by: rdhanek
12 Replies

3. UNIX for Dummies Questions & Answers

Linux shortcutkey to search specific file from a list of directory?!

Hi, I'm the new user of linux/unix. Can I ask that anybody know how to use the linux/unix shortcut key to search a specific file from a list of directory? For example, I know the file name that I want to search. But I forget which directory or location is my desired file put.Got any shortcut... (7 Replies)
Discussion started by: patrick87
7 Replies

4. Shell Programming and Scripting

Search a file with keywords

Hi All I have a file of format asdf asf first sec endi asdk rt 123 ferf dfg ijglkp (7 Replies)
Discussion started by: mailabdulbari
7 Replies

5. UNIX for Advanced & Expert Users

Need to search for keywords within files modified at a certain time

I have a huge list of files in an Unix directory (around 10000 files). I need to be able to search for a certain keyword only within files that are modified between certain date and time, say for e.g 2012-08-20 12:30 to 2012-08-20 12:40 Can someone let me know what would be the fastest way... (10 Replies)
Discussion started by: virtual123
10 Replies

6. Shell Programming and Scripting

search between keywords and make a single line

have a very big file where need to format it like below example file: abcd today is great day; search keyword 'abcd' and append to it all words till we reach ; to make it a single line. output should look like. abcd today is great day; There are many occurrence of such... (2 Replies)
Discussion started by: giri4332
2 Replies

7. Shell Programming and Scripting

Perl - use search keywords from array and search a file and print 3rd field when matched

Hi , I have been trying to write a perl script to do this job. But i am not able to achieve the desired result. Below is my code. my $current_value=12345; my @users=("bob","ben","tom","harry"); open DBLIST,"<","/var/tmp/DBinfo"; my @input = <DBLIST>; foreach (@users) { my... (11 Replies)
Discussion started by: chidori
11 Replies

8. Shell Programming and Scripting

Search files in directory for keywords using bash

I have ~100 text files in a directory that I am trying to parse and output to a new file. I am looking for the words chr,start,stop,ref,alt in each of the files. Those fields should appear somewhere in those files. The first two fields of each new set of rows is also printed. Since this is on a... (7 Replies)
Discussion started by: cmccabe
7 Replies

9. UNIX for Beginners Questions & Answers

Search strings from a file in files in a directory recursively; then print the string with a status

Hi All, I hope somebody would be able to help me. I would need to search a string coming from a file, example file.txt: dog cat goat horse fish For every string, I would need to know if there are any files inside a directory(recursively) that contains the string regardless of case.... (9 Replies)
Discussion started by: kokoro
9 Replies
LaTeXML::Util::Pathname(3pm)				User Contributed Perl Documentation			      LaTeXML::Util::Pathname(3pm)

NAME
"LaTeXML::Util::Pathname" - portable pathname and file-system utilities DESCRIPTION
This module combines the functionality File::Spec and File::Basename to give a consistent set of filename utilties for LaTeXML. A pathname is represented by a simple string. Pathname Manipulations "$path = pathname_make(%peices);" Constructs a pathname from the keywords in pieces dir : directory name : the filename (possibly with extension) type : the filename extension "($dir,$name,$type) = pathname_split($path);" Splits the pathname $path into the components: directory, name and type. "$path = pathname_canonical($path);" Canonicallizes the pathname $path by simplifying repeated slashes, dots representing the current or parent directory, etc. "$dir = pathname_directory($path);" Returns the directory component of the pathname $path. "$name = pathname_name($path);" Returns the name component of the pathname $path. "$type = pathname_type($path);" Returns the type component of the pathname $path. "$path = pathname_concat($dir,$file);" Returns the pathname resulting from concatenating the directory $dir and filename $file. "$boole = pathname_is_absolute($path);" Returns whether the pathname $path appears to be an absolute pathname. "$path = pathname_relative($path,$base);" Returns the path to file $path relative to the directory $base. "$path = pathname_absolute($path,$base);" Returns the absolute pathname resulting from interpretting $path relative to the directory $base. If $path is already absolute, it is returned unchanged. File System Operations "$modtime = pathname_timestamp($path);" Returns the modification time of the file named by $path, or undef if the file does not exist. "$path = pathname_cwd();" Returns the current working directory. "$dir = pathname_mkdir($dir);" Creates the directory $dir and all missing ancestors. It returns $dir if successful, else undef. "$dest = pathname_copy($source,$dest);" Copies the file $source to $dest if needed; ie. if $dest is missing or older than $source. It preserves the timestamp of $source. "$path = pathname_find($name,%options);" Finds the first file named $name that exists and that matches the specification in the keywords %options. An absolute pathname is returned. If $name is not already an absolute pathname, then the option "paths" determines directories to recursively search. It should be a list of pathnames, any relative paths are interpreted relative to the current directory. If "paths" is omitted, then the current directory is searched. If the option "installation_subdir" is given, it indicates, in addition to the above, a directory relative to the LaTeXML installation directory to search. This allows files included with the distribution to be found. The "types" option specifies a list of filetypes to search for. If not supplied, then the filename must match exactly. "@paths = pathname_findall($name,%options);" Like "pathname_find", but returns all matching paths that exist. AUTHOR
Bruce Miller <bruce.miller@nist.gov> COPYRIGHT
Public domain software, produced as part of work done by the United States Government & not subject to copyright in the US. perl v5.10.1 2009-06-11 LaTeXML::Util::Pathname(3pm)
All times are GMT -4. The time now is 09:44 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy