I would like to do this:
replace the word "prod" with the word "special" but it may occur through the file naturally without a command, I only want it to happen when it has a specific command in front of it. The command will always look like this
<IMG,###,###,##,>prod/directory/IMG/file
... (4 Replies)
From my understanding when using regex1|regex2 the matching process tries each alternative in turn, from left to right, and the first one that succeeds is used.
When im trying to extract the name from those examples:
A) name.can.be.different.20.03.2009.boom
B)... (2 Replies)
I am having trouble parsing rpm filenames in a shell script.. I found a snippet of perl code that will perform the task but I really don't have time to rewrite the entire script in perl. I cannot for the life of me convert this code into something sed-friendly:
if ($rpm =~ /(*)-(*)-(*)\.(.*)/)... (1 Reply)
Hello,
I'd like to write a regex that transforms a German base form of a noun into one of its inflected forms, namely
I want to translate "Haus" to "Häuser"
This is what I've got:
/^(.+)$/_Umlaut( $1 )_er/
where _Umlaut( x )_ is a function operating on the noun stem captured by $1 The... (1 Reply)
Hi,
I want to validate strings in perl, the string may contains characters from a-zA-Z0-9 and symbols +-_.:/\
To validate such a string I computed a regex
if ($string =~ m/^/) {
print "valid";
} else {
print "invalid";
}
but this regex also validates strings that contain... (8 Replies)
Hi,
Could you please help me in writing a regex for the following requirement?
Let following be the string format:
abc.cdef.ghij.lm
I need to check between dots, there is atleast one character{a-z,A-Z,*}.
Eg: abc1.gt2.345j is valid, but not 123.abc.vff.gth because 123 should not be... (2 Replies)
I am looking for the proper regex to match the hostname "areagc11" of this log.... Any help would be awsome:)
Oct 25 11:08:18 areagc11 961: Oct 25 18:08:17.536 GMT: %SYS-5-CONFIG_I: Configured from console by someone onvty1 (10.156.72.97) (6 Replies)
Hi,
Have to filter out string before the last underscore in the following
input: UNIX_Solaris_59_KSH
output: UNIX_Solaris_59
dummy one but :mad:
Thanks & Regards,
Sourabh Singh Khichi (4 Replies)
Hi all, please can anyone show me how to use sed and regular expressions to achieve the following.
If a line contains a capital A followed by exactly 5 or 6 characters followed by an angled bracket then insert an asterix before the angled bracket.
So:
XCONFIGA12345<X
Becomes:
... (5 Replies)
hi
i would like to say "DATABASENAME=" to "TABLESNAME="
remove "," and press enter myconfig file
thanks (1 Reply)
Discussion started by: mnnn
1 Replies
LEARN ABOUT REDHAT
apache::testconfig
Apache::TestConfig(3) User Contributed Perl Documentation Apache::TestConfig(3)NAME
Apache::TestConfig -- Test Configuration setup module
SYNOPSIS
use Apache::TestConfig;
my $cfg = Apache::TestConfig->new(%args)
my $fh = $cfg->genfile($file);
$cfg->writefile($file, $content);
$cfg->gendir($dir);
...
DESCRIPTION
"Apache::TestConfig" is used in creating the "Apache::Test" configuration files.
FUNCTIONS
genwarning()
my $warn = $cfg->genwarning($filename)
genwarning() returns a warning string as a comment, saying that the file was autogenerated and that it's not a good idea to modify this
file. After the warning a perl trace of calls to this this function is appended. This trace is useful for finding what code has created
the file.
genwarning() automatically recognizes the comment type based on the file extension. If the extension is not recognized, the default "#"
style is used.
Currently it support "<!-- -->", "/* ... */" and "#" styles.
genfile()
my $fh = $cfg->genfile($file);
genfile() creates a new file $file for writing and returns a file handle.
A comment with a warning and calls trace is added to the top of this file. See genwarning() for more info about this comment.
If parent directories of $file don't exist they will be automagically created.
The file $file and any created parent directories (if found empty) will be automatically removed on cleanup.
writefile()
$cfg->writefile($file, $content, [$nowarning]);
writefile() creates a new file $file with the content of $content.
A comment with a warning and calls trace is added to the top of this file unless $nowarnings is passed and set to a true value. See
genwarning() for more info about this comment.
If parent directories of $file don't exist they will be automagically created.
The file $file and any created parent directories (if found empty) will be automatically removed on cleanup.
write_perlscript()
$cfg->write_perlscript($filename, @lines);
Similar to writefile() but creates an executable Perl script with correctly set shebang line.
gendir()
$cfg->gendir($dir);
gendir() creates a new directory $dir.
If parent directories of $dir don't exist they will be automagically created.
The directory $dir and any created parent directories will be automatically removed on cleanup if found empty.
AUTHOR SEE ALSO perl(1), Apache::Test(3)perl v5.8.0 2002-09-10 Apache::TestConfig(3)