Sponsored Content
Top Forums Shell Programming and Scripting Search if file exists for a file pattern stored in array Post 302935923 by 100bees on Friday 20th of February 2015 08:51:19 AM
Old 02-20-2015
Hi i tried with find and it says `${filepath[*]}' also is not expected.
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Prase a file and stored the result to an array

Dear all , I have a file whose content has the following format: jboss.web:type=ThreadPool,name=AAAA jboss.web:type=ThreadPool,name=BBBB How can I parse this file to get the value of the name of each line (AAAA , BBBB) and store the result to an array ? (array = AAAA , array = BBBB).... (4 Replies)
Discussion started by: youareapkman
4 Replies

2. Shell Programming and Scripting

check if file exists with pattern matching

Hello friends, I am writing a simple shell script which will copy one particular type of files to backup folder if files exists. If files doesn't exists, mv command should not be executed. My file pattern is like wcm-spider-maestro.log.2009-07-15, wcm-spider-maestro.log.2009-07-16 etc.. I... (6 Replies)
Discussion started by: sreenu.shell
6 Replies

3. Shell Programming and Scripting

Grep pattern from different file and display if it exists in the required file

Hi, I have two files say xxx.txt and yyy.txt. xxx.txt is with list of patterns within double quotes. Eg. "this is the line1" "this is the line2" The yyy.txt with lot of lines. eg: "This is a test message which contains rubbish information just to fill the page which is of no use. this is... (3 Replies)
Discussion started by: abinash
3 Replies

4. UNIX for Dummies Questions & Answers

Need help finding a file where a pattern exists and the file has a timestamp

So, I know how to do some of this stuff on an individual level, but I'm drawing a blank as to how to put it all together. I have a pattern that I'm looking for in a log file. The log file I know came in yesterday, so I want to limit the search to that day's listing of files. How would I do... (5 Replies)
Discussion started by: kontrol
5 Replies

5. UNIX for Dummies Questions & Answers

Searching for a pattern from filenames stored in a file

Hi, I have got some 10 filenames stored in a file or displayed in the console as a result of some query i made.. Now I need to open each of these files and search for a pattern in these 10 files.. Can someone help me with this? Thanks, Jean (9 Replies)
Discussion started by: jeanjkj
9 Replies

6. Shell Programming and Scripting

Want to Insert few lines which are stored in some file before a pattern in another file

Hello, I have few lines to be inserted in file_lines_to_insert. In another file final_file, I have to add lines from above file file_lines_to_insert before a particular pattern. e.g. $ cat file_lines_to_insert => contents are abc def lkj In another file final_file, before a... (6 Replies)
Discussion started by: nehashine
6 Replies

7. Shell Programming and Scripting

Check for Pattern if exists write to file

Hi ! All I just want to search and write to new file if pattern is found in text file following are my text files by which I want to search Month and last column number my text file1 15-Jan-2011 25 ARTS 1255 125 125 178 198 15-Jan-2011 25 ARTS 1255 125 125 178 198 15-Jan-2011 25... (3 Replies)
Discussion started by: nex_asp
3 Replies

8. Shell Programming and Scripting

Search for a pattern that exists in the codebase

Hello everyone, I want to search for a specific pattern in the entire codebase that exists. Pattern: I need to find wherever there is a harcoded value "Vxxxx" and "GCxxxx" exists in the perl scripts and shell scripts. (where xxxx will be always number) I need the script name and the value... (1 Reply)
Discussion started by: filter
1 Replies

9. Shell Programming and Scripting

How to search a filename stored in a variable using a pattern?

hi, i have a variable which contains some file names delimited by a single space. FNAME="s1.txt s2.lst s3.cvs s4.lst" i have another variable that contains a pattern FILE_PATTERN="*.lst" i want to take the filenames from FNAME variable and assign each file name in to an array say for... (8 Replies)
Discussion started by: Little
8 Replies

10. UNIX for Beginners Questions & Answers

If file pattern exists in directory then continue

he below looks in $dir for any pattern of fileone. As is, it executes but only returns File found if the exact format in the script exsists. Why isn't a pattern of fileone being looked for and if it is in $dir, File found. I think that is what should happen. Thank you :). dir=/path/to if... (5 Replies)
Discussion started by: cmccabe
5 Replies
tt_file_objects_query(library call)									       tt_file_objects_query(library call)

NAME
tt_file_objects_query -- find all objects in the named file SYNOPSIS
#include <Tt/tt_c.h> Tt_status tt_file_objects_query( const char *filepath, Tt_filter_function filter, void *context, void *accumulator); DESCRIPTION
The tt_file_objects_query function instructs the ToolTalk service to find all objects in the named file and pass the objids to the filter function. The context pointer and accumulator pointer initially specified are also passed to the filter function. As the ToolTalk service finds each object, it calls the filter function, passing the objid of the object and the two application-supplied pointers. The filter function performs its computation and returns a Tt_filter_action value that tells the query function whether to con- tinue or to stop. Tt_filter_action values are: TT_FILTER_CONTINUE The query function should continue. TT_FILTER_STOP The query function should stop. The filepath argument is the name of the file to be searched for objects. The filter argument is the filter function to which the objids are to be passed. The context argument is a pointer to any information the filter needs to execute. The ToolTalk service does not inter- pret this argument, but passes it directly to the filter function. The accumulator argument is a pointer to where the filter is to store the results of the query and filter operations. The ToolTalk service does not interpret this argument, but passes it directly to the fil- ter function. RETURN VALUE
Upon successful completion, the tt_file_objects_query function returns the status of the operation as one of the following Tt_status val- ues: TT_OK The operation completed successfully. TT_ERR_DBAVAIL The ToolTalk service could not access the ToolTalk database needed for this operation. TT_ERR_DBEXIST The ToolTalk service could not access the specified ToolTalk database in the expected place. TT_ERR_NOMP The ttsession(1) process is not running and the ToolTalk service cannot restart it. TT_ERR_PATH The specified pathname included an unsearchable directory. TT_WRN_STOPPED The query operation being performed was halted by Tt_filter_function. SEE ALSO
Tt/tt_c.h - Tttt_c(5). tt_file_objects_query(library call)
All times are GMT -4. The time now is 10:54 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy