12-13-2011
wow how do you guys learn all these... with strange expressions.. like regular expressions... you guys made it all look simple... :-)
10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
Using a HTML page , i'm running a Unix ksh script with <a href=..>.
The script contains loop like this :
for i in
do
rsh.....
done
each rsh command is running quite long and then i would display results in HTML format but about 5mn my blank page waiting for result is running in error... (1 Reply)
Discussion started by: Nicol
1 Replies
2. Shell Programming and Scripting
hy,
i have an html file
file1.html
i want to display a browser i.e html file1 from a ksh script
-------------------------------------------------------------------
#!/bin/ksh
----------------------------------------------\\
so can u tell me how to display file1.html as a browser.wat... (2 Replies)
Discussion started by: ali560045
2 Replies
3. Shell Programming and Scripting
Hi,
I got a long list of contents:
>sequence_1
ASSSSSSSSSSSDDDDDDDDDDDCCCCCCC
ASDSFDFFDFDFFWERERERERFSDFESFSFD
>sequence_2
ASDFDFDFFDDFFDFDSFDSFDFSDFSDFDSFASDSADSADASD
ASDFFDFDFASFASFASFAFSFFSDASFASFASFAFS
>sequence_3
VEDFGSDGSDGSDGSDGSDGSDGSDG
dDFSDFSDFSDFSDFSDFSDFSDFSDF... (2 Replies)
Discussion started by: patrick87
2 Replies
4. Shell Programming and Scripting
Hi - Help needed.
I have an input file that looks something like this, but with a lot more entries:
A
Customer1
B
4500
C
8000
A
Customer2
B
6422
C
8922
I need to be able to print details for each customer on one line per customer.
ie. if I could print these to a file and then cat... (3 Replies)
Discussion started by: frustrated1
3 Replies
5. Shell Programming and Scripting
Hi
I am new to this Scripting process and would like to know How can i write a ksh script that will call other ksh scripts and write the output to a file and/or email.
For example
-------
Script ABC
-------
a.ksh
b.ksh
c.ksh
I need to call all three scripts execute them and... (2 Replies)
Discussion started by: pacifican
2 Replies
6. Shell Programming and Scripting
*****************************************
Right now i have this current system.
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... (7 Replies)
Discussion started by: abinash
7 Replies
7. UNIX and Linux Applications
Hi,
I'm trying to figure out a way to find which line in my file.txt with IP addresses:
192.168.0.1
192.178.0.2
etc...
returns specific result when I execute command affecting all lines.
For example when I run:
for line in `cat file.txt`;
do
snmpget $line
done
it displays the... (5 Replies)
Discussion started by: svetoslav_sj
5 Replies
8. Homework & Coursework Questions
Use and complete the template provided. The entire template must be completed. If you don't, your post may be deleted!
1. The problem statement, all variables and given/known data:
What single command line would you enter to get the following output?
8140 drwxr-xr-x 9 root bin 18 Jan 20... (6 Replies)
Discussion started by: dasboot
6 Replies
9. UNIX for Dummies Questions & Answers
Hi -- Working on my own through the book "Learning the KornShell and came to task 4-1, which there is:
a script "highest" and it will sort an "album" file.
highest filename
The author mentions adding a header line to the scripts output if the user types in the -h option. It says "assume the... (9 Replies)
Discussion started by: Decoy Octopus88
9 Replies
10. Shell Programming and Scripting
I pass a number to my script. Passing "1" below.
./getfile.sh 1
echo "User entered: $1"
ls -ltr *.conf | sed -n '$p'
I wish to use ls -ltr i.e list files in ascending order of time the latest showing at the bottom of the output.
Number 1 should get me the last row of ls -ltr output i.e... (9 Replies)
Discussion started by: mohtashims
9 Replies
LEARN ABOUT DEBIAN
perl::critic::policy::regularexpressions::requireextendedformatt
Perl::Critic::Policy::RegularExpressions::RequireExtendeUsermContributed PPerl::Critic::Policy::RegularExpressions::RequireExtendedFormatting(3pm)
NAME
Perl::Critic::Policy::RegularExpressions::RequireExtendedFormatting - Always use the "/x" modifier with regular expressions.
AFFILIATION
This Policy is part of the core Perl::Critic distribution.
DESCRIPTION
Extended regular expression formatting allows you mix whitespace and comments into the pattern, thus making them much more readable.
# Match a single-quoted string efficiently...
m{'[^\']*(?:\.[^\']*)*'}; #Huh?
# Same thing with extended format...
m{
' # an opening single quote
[^\'] # any non-special chars (i.e. not backslash or single quote)
(?: # then all of...
\ . # any explicitly backslashed char
[^\']* # followed by an non-special chars
)* # ...repeated zero or more times
' # a closing single quote
}x;
CONFIGURATION
You might find that putting a "/x" on short regular expressions to be excessive. An exception can be made for them by setting
"minimum_regex_length_to_complain_about" to the minimum match length you'll allow without a "/x". The length only counts the regular
expression, not the braces or operators.
[RegularExpressions::RequireExtendedFormatting]
minimum_regex_length_to_complain_about = 5
$num =~ m<(d+)>; # ok, only 5 characters
$num =~ m<d.(d+)>; # not ok, 9 characters
This option defaults to 0.
Because using "/x" on a regex which has whitespace in it can make it harder to read (you have to escape all that innocent whitespace), by
default, you can have a regular expression that only contains whitespace and word characters without the modifier. If you want to restrict
this, turn on the "strict" option.
[RegularExpressions::RequireExtendedFormatting]
strict = 1
$string =~ m/Basset hounds got long ears/; # no longer ok
This option defaults to false.
NOTES
For common regular expressions like e-mail addresses, phone numbers, dates, etc., have a look at the Regexp::Common module. Also, be
cautions about slapping modifier flags onto existing regular expressions, as they can drastically alter their meaning. See
<http://www.perlmonks.org/?node_id=484238> for an interesting discussion on the effects of blindly modifying regular expression flags.
TO DO
Add an exemption for regular expressions that contain "Q" at the front and don't use "E" until the very end, if at all.
AUTHOR
Jeffrey Ryan Thalhammer <jeff@imaginative-software.com>
COPYRIGHT
Copyright (c) 2005-2011 Imaginative Software Systems. All rights reserved.
This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself. The full text of this license
can be found in the LICENSE file included with this module.
perl v5.14.2 2012-0Perl::Critic::Policy::RegularExpressions::RequireExtendedFormatting(3pm)