08-30-2012
I'm not terribly familiar with perl, but assuming the s/... works like normal sed: I would guess it's matching the entire 'ram' element @actiontext[2], but you're only replacing the 'ram' part with $2 (or actually nothing, for that match) - leaving the remainder of that element to be put into @action[1].
10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
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)
Discussion started by: sdubey
3 Replies
2. Shell Programming and Scripting
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)
Discussion started by: helengoldman
1 Replies
3. Shell Programming and Scripting
hi,
i want to extract the sessionID from this line.
QnA Session Id :
here the output should be--
QnA_SessionID=128589
Thanks
NT (3 Replies)
Discussion started by: namishtiwari
3 Replies
4. Shell Programming and Scripting
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)
Discussion started by: lsaas
5 Replies
5. Shell Programming and Scripting
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)
Discussion started by: asth
1 Replies
6. Shell Programming and Scripting
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)
Discussion started by: bataf
0 Replies
7. Shell Programming and Scripting
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)
Discussion started by: suppandi7
5 Replies
8. Shell Programming and Scripting
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)
Discussion started by: kittyluva2
4 Replies
9. Shell Programming and Scripting
Hi I am doing something basic like...
if ($stringvariable =~ /have not typed/)
I have a little problem because the 'not' in the expression gets highlighted as a kind of a '!'..what am I supposed to do in this situation?
Thank you
---------- Post updated at 03:24 PM ----------... (1 Reply)
Discussion started by: vas28r13
1 Replies
10. Programming
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)
Discussion started by: jessy83
1 Replies
LEARN ABOUT CENTOS
new-kernel-pkg
NEW-KERNEL-PKG(8) System Manager's Manual NEW-KERNEL-PKG(8)
NAME
new-kernel-pkg - tool to script kernel installation
SYNOPSIS
new-kernel-pkg [-v] [--mkinitrd] [--rminitrd] [--dracut]
[--initrdfile=initrd-image [--depmod] [--rmmoddep]
[--kernel-args=args] [--remove-args=args]
[--banner=banner] [--multiboot=multiboot]
[--mbargs=mbargs] [--make-default] [--add-dracut-args]
[--add-plymouth-initrd] [--host-only]
<--install | --remove | --update | --rpmposttrans> <kernel-version>
DESCRIPTION
new-kernel-pkg is a tool used in packaging to automate the installation of a new kernel, including the creation of an initial ram filesys-
tem image, updating of bootloader configuration, and other associated tasks.
OPTIONS
-v Be verbose.
--mkinitrd
Create a new initial ram filesystem image.
--rminitrd
Remove an initial ram filesystem image.
--dracut
When creating a new initial ram filesystem image, use dracut(8) rather than mkinitrd(8). Used in conjunction with --mkinitrd .
--initrdfile=initrd-image
Use the specified file as the initial ram filesystem image.
--depmod
Create modules.dep and related files.
--rmmoddep
Remove modules.dep and related files.
--kernel-args=args
Use args as the boot command line for this kernel.
--remove-args=args
Remove specified kernel arguments for this kernel.
--banner=banner
Display banner as the banner text in the bootloader.
--multiboot=multiboot-image
Use multiboot-image as a multiboot image.
--mbargs=mbargs
Use mbargs as arguments to the multiboot image.
--make-default
Make this kernel the default boot option.
--add-dracut-args
Automatically generate dracut options and add them to the kernel command line.
--add-plymouth-initrd
Automatically add plymouth to the initial ram filesystem image.
--host-only
Make an initial ram filesystem image that is specific to the running system.
--install kernel-version
Install a new kernel.
--remove kernel-version
Remove an installed kernel.
--update kernel-version
Update the specified kernel.
--rpmposttrans kernel-version
Run the rpmposttrans for the specified kernel.
SEE ALSO
grubby(8) installkernel(8)
AUTHORS
Erik Troan
Jeremy Katz
Peter Jones
Wed Apr 14 2010 NEW-KERNEL-PKG(8)