04-21-2020
man bash:
Quote:
Pathname Expansion
Pattern Matching
Any character that appears in a pattern, other than the special pattern characters described below, matches itself.
.
.
.
[...] Matches any one of the enclosed characters. A pair of characters separated by a hyphen denotes a range expression; any character
that falls between those two characters, inclusive, using the current locale's collating sequence and character set, is matched.
So one
[0-9] means one character from (the range) 0 through 9.
This User Gave Thanks to RudiC For This Post:
10 More Discussions You Might Find Interesting
1. Programming
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
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
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
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
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
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
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
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
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
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
MATCH(1L) Schily's USER COMMANDS MATCH(1L)
NAME
match - searches for patterns in files
SYNOPSIS
match [ -option ] pattern [ file ... ]
DESCRIPTION
Match searches the named files or standard input (if no filenames are given) for the occurrences of the given pattern on each line. The
program accepts literal characters or special pattern matching characters. All lines that match the pattern are output on standard output.
You can only specify one pattern string for each match, however, you can construct an arbitrarily complex string. When you do not specify
a file, match can be used as a filter to display desired lines. Standard in is used if no files are specified.
OPTIONS
-not, -v
Prints all lines that do not match.
-i Ignore the case of letters
-m Force not to use the magic mode
-w Search for pattern as a word
-x Display only those lines which match exactly
-c Display matching count for each file
-l Display name of each file which matches
-s Be silent indicate match in exit code
-h Do not display filenames
-n Precede matching lines with line number (with respect to the input file)
-b Precede matching lines with block number
REGULAR EXPRESSIONS
The following is a table of all the pattern matching characters:
c An ordinary character (not one of the special characters discussed below) is a one character regular expression that matches that
character.
c A backslash () followed by any special character is a one character regular expression that matches the special character itself.
The special characters are:
! # % * { } [ ] ? ^ $
! Logical OR as in match this!that!the_other. You may have to use `{}' for precedence grouping.
# A hash mark followed by any regular expression matches any number (including zero) occurrences of the regular expression.
? Matches exactly any one character. W? matches Wa, Wb, Wc, W1, W2, W3 ...
* Matches any number of any character.
% Matches exactly nothing. It can be used in groups of ored patterns to specify that an empty alternative is possible.
{} Curly brackets may be used to enclose patterns to specify a precedence grouping, and may be nested. {%!{test}}version matches the
strings testversion and version.
[string]
A non empty string of characters enclosed in square brackets is a one character regular expression that matches any one character in
that string. If however the first character of the string is a circumflex (^), the one character expression matches any character
which is not in the string. The ^ has this special meaning only if it occurs first in the string. The minus (-) may be used to indi-
cate a range of consecutive ASCII characters; for example, [0-9] is equivalent to any one of the digits. The - loses it's special
meaning if it occurs first (after an initial ^, if any) or last in the string. The right square bracket (]) and the backslash ()
must be quoted with a backslash if you want to use it within the string.
^ Matches the beginning of a line.
$ Matches the end of a line. (^*$ matches any entire line)
EXAMPLES
FILES
None.
SEE ALSO
grep(1), fgrep(1), egrep(1)
DIAGNOSTICS
NOTES
Even if a match occurs more than once per line, the line is output only once.
Quote special pattern matching characters to prevent them from being expanded by the Command Interpreter.
BUGS
The length of the pattern is currently limited to 100 characters.
This limit is reduced by 38 if the -w option is used.
Joerg Schilling 15. Juli 1988 MATCH(1L)