a little more succintly, and taking advantage of perl's advanced regular expressions:
in perl regexps, \w will match any alphanumeric and the underscore character. When you use an alternate delineator like #, you don't have to escape out '/'. Finally, using a + instead of a * outside of the grouping will require the expression to match at least one single character, whereas Ygor's will also match a blank string.
Hi all,
I am trying to match a multi line string and return the matching string in one line. Here is the perl code that I wrote:
#!/usr/bin/perl
my $str='<title>My
title</title>';
if ($str =~ /(<title>)(+)(<\/title>)/ ){
print "$2\n";
}
It returns :
My
title
I want the... (3 Replies)
letz say that my file has 7 records with only one field. So my file has:
11111111
000000000000000
1111
aaaabbbccc
1111111222000000
aaaaaaaa
zz
All i need is:
1. when the field has a repetition of the same instance(a-z or 0-9), i would consideer it to be invalid.... (1 Reply)
Hello all,
I need to match the red expressions in the following lines :
MACRO_P+P-_scrambledServices_REM_PRC30.xml
MACRO_P+P-_scrambledServices_REM_RS636.xml
MACRO_P+P-_scrambledServices_REM_RS535.xml
and so on...
Can anyone give me a PERL regular expression to match those characters ?
... (5 Replies)
Hi,
I need and expression for a word like abc_xyz_ykklm
The expresion should indicate that the word starts with abc and end with ykklm but does not contain xyz string in the middle.
Example: abc_tmn_ykklm is ok and abc_xyz_ykklm is not Ok.
Please help.
Regards. (1 Reply)
Hello,
I am trying to use perl LWP module to read and get a specfic URL page. The issue is that the URL ends with the data and time and time is not consistent it changes all the time. if anyone could help me how to write a regular expressin that would work in the LWP::UserAgent get function to... (0 Replies)
Could you help me with this please. This regular expression seems to match for the wrong input
#!/usr/bin/perl
my $inputtext = "W1a$%XXX";
if($inputtext =~ m/+X+/)
{
print "matches\n";
}
The problem seems to be %. if inputtext is W1a$XXX, the regex doesnot match.... (5 Replies)
I am completely new to perl programming. My father is helping me learn said programming language. However, I am stuck on one of the assignments he has given me, and I can't find very much help with it via google, either because I have a tiny attention span, or because I can be very very dense.
... (4 Replies)
Hi all,
How am I read a file, find the match regular expression and overwrite to the same files.
open DESTINATION_FILE, "<tmptravl.dat" or die "tmptravl.dat";
open NEW_DESTINATION_FILE, ">new_tmptravl.dat" or die "new_tmptravl.dat";
while (<DESTINATION_FILE>)
{
# print... (1 Reply)
Hi ,
I have the below array
my @actionText = ("delivered to governor on 21/23/3345" , "deliver jllj" , "ram 2345/43");
When i am trying to grep the contents of array and if mathced substituting with the digitis or some date format from the element like below
my @action = grep { $_ =~... (7 Replies)
Discussion started by: ragilla
7 Replies
LEARN ABOUT DEBIAN
cgsnapshot
CGSNAPSHOT(1) libcgroup Manual CGSNAPSHOT(1)NAME
cgsnapshot - generate the configuration file for given controllers
SYNOPSIS
cgsnapshot [-h] [-s] [-t] [-b file] [-w file] [-f output_file] [controller] [...]
DESCRIPTION
cgsnapshot generates the cgconfig compatible configuration file for the given controllers. If no controller is set, then cgsnapshot shows
all mounted hierarchies. The output is in the same format as the cgconfig.conf configuration file.
-b file
Display only variables from the blacklist. The default location of the blacklist is /etc/cgsnapshot_blacklist.conf. This list con-
tains all variables which should be ignored by the cgsnapshot If the variable is blacklisted, it will not be displayed. If it is
not present on the blacklist, the whitelist is checked.
-h, --help
display this help and exit
-f, --file
Redirect the output to output_file
-s, --silent
Ignore all warnings
-t, --strict
Do not display the variables which are not on the whitelist
-w file
Set the blacklist configuration file. This list contains all variables which should be displayed by cgsnapshot If the variable is
not blacklisted, the whitelist is checked. If the variable is on the whitelist, it is displayed by cgsnapshot If the variable is
not on the whitelist, the variable is displayed and a warning message is produced. By default the whitelist is not used.
The warning message can be omitted using the -s, --silent flag. If the -t, --strict flag is used, the variable which is not on the
whitelist is not displayed.
controller
defines the controller whose hierarchies will be output
FILES
/etc/cgsnapshot_blacklist.conf
default blacklist
/etc/cgsnapshot_whitelist.conf
default whitelist
/etc/cgconfig.conf
default libcgroup configuration file
SEE ALSO
cgconfig.conf (5)
Linux 2010-07-28 CGSNAPSHOT(1)