07-24-2018
I'm afraid you'll have to experiment a bit on your own. Try to supply the escaped opening parenthesis in line 14 by two \\ instead of one, or by enclosing it by a pair of square brackets, so it doesn't offend the regex parser.
10 More Discussions You Might Find Interesting
1. UNIX for Advanced & Expert Users
Hi every one,
We have HP UX server which normally loaded as avg load of 19-21.
NOw when I try and do ftp to this server it takes ages to get the FTP prompt.
I have seen this server loaded as max agv load of 35-40 tht time we never had such problems of FTP sessions.
Now my new Unix admin... (1 Reply)
Discussion started by: nilesrex
1 Replies
2. Shell Programming and Scripting
How to make a script run for a maximum of "x" number of hours only (7 Replies)
Discussion started by: ScriptDummy
7 Replies
3. UNIX for Dummies Questions & Answers
Hi all,
I'm having some trouble with a shell script that I have put together to search our web pages for links to PDFs.
The first thing I did was:
ls -R | grep .pdf > /tmp/dave_pdfs.outWhich generates a list of all of the PDFs on the server. For the sake of arguement, say it looks like... (8 Replies)
Discussion started by: Dave Stockdale
8 Replies
4. HP-UX
Hi All
I have a problem, I wonder if you can help me sort it out:
I have the following entry in the cron:
00 1,13 * * * /home/report/opn_amt_gestores_credito.ksh > opn_amt_gestores_credito.log
But the entry only runs at 01:07
I have stopped the cron deamon, and started, but it still... (39 Replies)
Discussion started by: fretagi
39 Replies
5. Shell Programming and Scripting
I want to parse a log file which i am grepping root user connection but is showing whole day and previous day detail as well.
First i want to see last 2 hours log file then after that i want to search particular string. Lets suppose right now its 5:00PM, So i want to see the log of 3:00PM to... (6 Replies)
Discussion started by: learnbash
6 Replies
6. Shell Programming and Scripting
This is my first experience writing unix script. I've created the following script. It does what I want it to do, but I need it to be a lot faster. Is there any way to speed it up?
cat 'Tax_Provision_Sample.dat' | sort | while read p; do fn=`echo $p|cut -d~ -f2,4,3,8,9`; echo $p >> "$fn.txt";... (20 Replies)
Discussion started by: JohnN6
20 Replies
7. UNIX for Advanced & Expert Users
Hi
I have task to zip files based on modified time but they are in millions and it is taking lot of time more than 12 hours and also eating up high cpu
is there any other / better way to handle it quickly with less cpu consumptionfind . ! -name \"*.gz\" -mtime +7 -type f | grep -v '/.*/' |... (2 Replies)
Discussion started by: reldb
2 Replies
8. Shell Programming and Scripting
HI Guys hoping some one can help
I have two files on both containing uk phone numbers
master is a file which has been collated over a few years ad currently contains around 4 million numbers
new is a file which also contains 4 million number i need to split new nto two separate files... (4 Replies)
Discussion started by: dunryc
4 Replies
9. Shell Programming and Scripting
Hi All,
I have a bash script which is scheduled to run for every 20 minutes. Inside the bash script, one command which I am using need to be triggered only once in two or three hours.Is there anyway to achieve this.
For example,
if
then
echo "hi"
else
echo "Hello"
UNIX Command---once... (5 Replies)
Discussion started by: ginrkf
5 Replies
10. Shell Programming and Scripting
Hello experts,
we have input files with 700K lines each (one generated for every hour). and we need to convert them as below and move them to another directory once.
Sample INPUT:-
# cat test1
1559205600000,8474,NormalizedPortInfo,PctDiscards,0.0,Interface,BG-CTA-AX1.test.com,Vl111... (7 Replies)
Discussion started by: prvnrk
7 Replies
LEARN ABOUT MOJAVE
perlrequick5.18
PERLREQUICK(1) Perl Programmers Reference Guide PERLREQUICK(1)
NAME
perlrequick - Perl regular expressions quick start
DESCRIPTION
This page covers the very basics of understanding, creating and using regular expressions ('regexes') in Perl.
The Guide
Simple word matching
The simplest regex is simply a word, or more generally, a string of characters. A regex consisting of a word matches any string that
contains that word:
"Hello World" =~ /World/; # matches
In this statement, "World" is a regex and the "//" enclosing "/World/" tells Perl to search a string for a match. The operator "=~"
associates the string with the regex match and produces a true value if the regex matched, or false if the regex did not match. In our
case, "World" matches the second word in "Hello World", so the expression is true. This idea has several variations.
Expressions like this are useful in conditionals:
print "It matches
" if "Hello World" =~ /World/;
The sense of the match can be reversed by using "!~" operator:
print "It doesn't match
" if "Hello World" !~ /World/;
The literal string in the regex can be replaced by a variable:
$greeting = "World";
print "It matches
" if "Hello World" =~ /$greeting/;
If you're matching against $_, the "$_ =~" part can be omitted:
$_ = "Hello World";
print "It matches
" if /World/;
Finally, the "//" default delimiters for a match can be changed to arbitrary delimiters by putting an 'm' out front:
"Hello World" =~ m!World!; # matches, delimited by '!'
"Hello World" =~ m{World}; # matches, note the matching '{}'
"/usr/bin/perl" =~ m"/perl"; # matches after '/usr/bin',
# '/' becomes an ordinary char
Regexes must match a part of the string exactly in order for the statement to be true:
"Hello World" =~ /world/; # doesn't match, case sensitive
"Hello World" =~ /o W/; # matches, ' ' is an ordinary char
"Hello World" =~ /World /; # doesn't match, no ' ' at end
Perl will always match at the earliest possible point in the string:
"Hello World" =~ /o/; # matches 'o' in 'Hello'
"That hat is red" =~ /hat/; # matches 'hat' in 'That'
Not all characters can be used 'as is' in a match. Some characters, called metacharacters, are reserved for use in regex notation. The
metacharacters are
{}[]()^$.|*+?
A metacharacter can be matched by putting a backslash before it:
"2+2=4" =~ /2+2/; # doesn't match, + is a metacharacter
"2+2=4" =~ /2+2/; # matches, + is treated like an ordinary +
'C:WIN32' =~ /C:\WIN/; # matches
"/usr/bin/perl" =~ //usr/bin/perl/; # matches
In the last regex, the forward slash '/' is also backslashed, because it is used to delimit the regex.
Non-printable ASCII characters are represented by escape sequences. Common examples are " " for a tab, "
" for a newline, and "
" for a
carriage return. Arbitrary bytes are represented by octal escape sequences, e.g., "