Sponsored Content
Top Forums UNIX for Beginners Questions & Answers Script to list Sequential files Post 303046009 by RudiC on Tuesday 21st of April 2020 02:17:14 PM
Old 04-21-2020
A bit difficult to believe your pattern matched bin.000999 as it is for the last two digits only, one per square bracket pattern. First pattern will match 0 and 1-9, second 1, 0-9, 9, and 9 (some redundancy, i'd say).
 

10 More Discussions You Might Find Interesting

1. Programming

indexed sequential access in c files

hi, I want to implement indexed sequential access method in my flat file, Any idea other than INFORMIX C-ISAM library, because it is not free ware, Any Freeware available? (0 Replies)
Discussion started by: vrkiruba
0 Replies

2. Shell Programming and Scripting

running script sequential

I have 4 scripts I need to run sequentially(can't run simultaneously) What's the syntax for it? I am running Korn Shell. Thanks, (2 Replies)
Discussion started by: ocjunky
2 Replies

3. Programming

Reading special characters while converting sequential file to line sequential

We have to convert a sequential file to a 80 char line sequential file (HP UX platform).The sequential file contains special characters. which after conversion of the file to line sequential are getting coverted into "new line" or "tab" and file is getting distorted. Is there any way to read these... (2 Replies)
Discussion started by: Rajeshsu
2 Replies

4. UNIX for Advanced & Expert Users

listing sequential files as one group...

Hi, I posted this over at Macnn and was redirected here... I'm not a unix programmer at all, but I have some backup if needed. Thanks in advance for any input. Is there a command for the osX terminal that will list sequentially numbered groups of file as one line instead of individually,... (1 Reply)
Discussion started by: kentm
1 Replies

5. UNIX for Dummies Questions & Answers

Sequential execution in shell script?

I've a shell script that invokes a URL of an application to do some work, e.g., http://www.abc.com/myservlet?action=helloworld.Does the shell wait for a return value from the URL call before proceeding to the next line of command? (6 Replies)
Discussion started by: chengwei
6 Replies

6. UNIX for Dummies Questions & Answers

merging of files ! not in sequential in paralel

Hi , I am having 3 files as FILE1 1 2 3 FILE2 4 5 6 FILE3 7 8 9 I want to merge thes file such that the resultnt file should be as (1 Reply)
Discussion started by: arunkumar_mca
1 Replies

7. Programming

Tool to simulate non-sequential disk I/O (simulate db file sequential read) in C POSIX

Writing a Tool to simulate non-sequential disk I/O (simulate db file sequential read) in C POSIX I have over the years come across the same issue a couple of times, and it normally is that the read speed on SAN is absolutely atrocious when doing non-sequential I/O to the disks. Problem being of... (7 Replies)
Discussion started by: vrghost
7 Replies

8. Shell Programming and Scripting

Rename files in sub directories with sequential numbers

I can rename a file with sequential numbers from 1 to N with this script: num=1 for file in *.dat;do mv "$file" "$(printf "%u" $num).txt" let num=num+1 done The script begins with renaming a some.dat file to 1.dat.txt and goes on sequentially renaming other DAT files to... (1 Reply)
Discussion started by: shoaibjameel123
1 Replies

9. Shell Programming and Scripting

Execute sequential files and store data in single file

1)In a particualr path i have a set of inputfiles like path:/defaultmis/MonthlyLoads/INFA_EXPORT_022013/map* example: 1)map_de 2)map_cod 3)map_feg ........and so on in above path there wil be nearly 15 to 20 files starting with map and in other path i have another file input file... (4 Replies)
Discussion started by: katakamvivek
4 Replies

10. Shell Programming and Scripting

Run sequential test files

I have c program that I run like this: ./a.out t1 And my test files look like this all the way up to 100: t1 t2 t3 Is there a way to run this more efficiently so I don't have to hit up and change the number every time? (4 Replies)
Discussion started by: cokedude
4 Replies
fnmatch(3)						     Library Functions Manual							fnmatch(3)

NAME
fnmatch - Matches filename patterns LIBRARY
Standard C Library (libc.so, libc.a) SYNOPSIS
#include <fnmatch.h> int fnmatch( const char *pattern, const char *string, int flags); STANDARDS
Interfaces documented on this reference page conform to industry standards as follows: fnmatch(): XPG4, XPG4-UNIX Refer to the standards(5) reference page for more information about industry standards and associated tags. PARAMETERS
Contains the pattern to which the string parameter is to be compared. Contains the string to be compared against the pattern parameter. Contains a bit flag specifying the configurable attributes of the comparison to be performed by the fnmatch function. The flags parameter modifies the interpretation of the pattern and string parameters. It is the bitwise inclusive OR (|) of 0 (zero) or more of the following flags, which are defined in the fnmatch.h file. Slash in the string parameter only matches slash in the pattern parameter. Leading period in the string parameter must be exactly matched by period in the pattern parameter. Unless FNM_NOESCAPE is set, preceding a character in pattern with a (backslash character) causes fnmatch() to match that character in string. For example, \ matches a backslash in string. If FNM_NOESCAPE is set, (backslash) is interpreted as an ordinary character. If the FNM_PATHNAME flag is set in the flags parameter, a / (slash) in the string parameter is explicitly matched by a / in the pattern parameter. It is not matched by either the * (asterisk) or ? (question-mark) special characters, nor by a bracket expression. If the FNM_PATHNAME flag is not set, the / is treated as an ordinary character. If FNM_PERIOD is set in the flags parameter, then a leading period in the string parameter only matches a period in the pattern parameter; it is not matched by either the asterisk or question-mark special characters, nor by a bracket expression. A period is determined to be leading according to the setting of the FNM_PATHNAME flag, according to the following rules: If the FNM_PATHNAME flag is set, a period is leading only if it is the first character in the string parameter or if it immediately follows a slash. If the FNM_PATHNAME flag is not set, a period is leading only if it is the first character of the string parameter. If FNM_PERIOD is not set, no special restrictions are placed on matching a period. A (backslash character) quotes the next character, unless FNM_NOESCAPE is set. If FNM_NOESCAPE is set, (backslash) is treated as itself. DESCRIPTION
The fnmatch() function checks the string specified by the string parameter to see if it matches the pattern specified by the pattern param- eter. This routine follows the match criteria of the glob() function. The fnmatch function is useful when a program needs to perform pattern matching, such as when a directory is to be searched for a particu- lar string (as is the case with the find command). A program like the pax command can also use the fnmatch() function to perform its pat- tern matching operations. RETURN VALUES
If the value in the string parameter matches the pattern specified by the pattern parameter, then the fnmatch() function returns 0 (zero). If there is no match, the fnmatch() function returns FNM_NOMATCH, which is defined in the fnmatch.h file. If an error occurs, the fnmatch() function returns a nonzero value. RELATED INFORMATION
Functions: glob(3), globfree(3), regcomp(3) Standards: standards(5) delim off fnmatch(3)
All times are GMT -4. The time now is 11:29 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy