*bling* Useless Use of Glob in Backticks! Also the "ls -l" actually is a rather grave error. You could simply drop the -l, but the whole ls is redundant.
If you have an fgrep which supports fgrep -q, use that.
zgrep is actually fairly buggy for stuff like this; other than that, it is the proper answer. It's a fairly small shell script so you could simply find it in Google and copy to your $HOME/bin
Hi,
I am writing a BASH script. I have a list of files and I would like to make sure that each is of a specific pattern (ie *.L2). If not I would like to remove that file. How do I test whether a filename matches a given pattern?
Thanks a lot.
Mike (10 Replies)
Hi,
I have a directory with around 100k files and files with varying sizes(10GB files to as low as 5KB). All the files are having pipe dilimited records.
I need to append 7 pipes to the end of each record, in each file whose name contains _X3_ and need to append 10 pipes to the end of each... (3 Replies)
Hi,
I have many scripts in particular directory. And few of the scripts have exit 0 in second line. Now i wanted to list out the scripts name which has the exit 0 in its second line
I tried many options , but i can not get the filename along with the nth line pattern match :mad:. Can anyone... (14 Replies)
Hi experts , im new to Unix,AWK ,and im just not able to get this right.
I need to match for some patterns if it matches I need to print the next few words to it.. I have only three such conditions to match… But I need to print only those words that comes after satisfying the first condition..... (2 Replies)
Im using the command below , but thats not the output that i want. it only prints the odd and even numbers.
awk '{if(NR%2){print $0 > "1"}else{print $0 > "2"}}'
Im hoping for something like this
file1:
Text hi this is just a test
text1 text2 text3 text4 text5 text6
Text hi... (2 Replies)
Guys -
Need your ideas on a section of code to finish something up. To make a long story short, I'm parsing a print output file that goes to pre-printed forms. I'm intercepting it, parsing it, formatting it, cutting it up into individual pages, grabbing the text I want in zones, building an... (3 Replies)
Hello All,
I have two issues.
1).I want to check if directory exists and inside that if file exists with today's date minus one. I can check directory exists but how can i check only a pattern of filename in that directory.Name of file is files-20170105-09.gz.
2).Also i want to exit immediately... (6 Replies)
Hi
In a file I have string in multiple lines. Like below:
<?=test.getObjectName("L", "testTBL","D") ?>
<?=test.getObjectName("L", "testTBL","testDB", "D") ?>
I want to use regex to search for the pattern "<?=test.getObjectName...?>"
If the parenthesis has 3 parameters then return 2nd... (5 Replies)
Discussion started by: dashing201
5 Replies
LEARN ABOUT HPUX
fc-pattern
FC-PATTERN(1)FC-PATTERN(1)NAME
fc-pattern - parse and show pattern
SYNOPSIS
fc-pattern [ -cdVh ] [ --config ] [ --default ] [ [ -f format ] [ --format format ] ] [ --version ] [ --help ]
[ pattern [ element... ] ]
DESCRIPTION
fc-pattern parses pattern (empty pattern by default) and shows the parsed result. If --config is given, config substitution is performed
on the pattern before being displayed. If --default is given, default substitution is performed on the pattern before being displayed.
If any elements are specified, only those are printed.
OPTIONS
This program follows the usual GNU command line syntax, with long options starting with two dashes (`-'). A summary of options is included
below.
-c Perform config substitution on pattern.
-d Perform default substitution on pattern.
-f Format output according to the format specifier format.
-V Show version of the program and exit.
-h Show summary of options.
pattern
Parses and displays pattern (uses empty pattern by default).
element
If set, the element property is displayed for parsed pattern.
SEE ALSO FcNameParse(3)FcConfigSubstitute(3)FcDefaultSubstitute(3)FcPatternPrint(3)FcPatternFormat(3)fc-cat(1)fc-cache(1)fc-list(1) fc-
match(1)fc-query(1)fc-scan(1)
The fontconfig user's guide, in HTML format: /usr/share/doc/fontconfig/fontconfig-user.html.
AUTHOR
This manual page was updated by Behdad Esfahbod <behdad@behdad.org>.
Apr 20, 2010 FC-PATTERN(1)