Sponsored Content
Full Discussion: Regex with sed
Top Forums Shell Programming and Scripting Regex with sed Post 303024090 by mnnn on Saturday 29th of September 2018 05:19:00 AM
Old 09-29-2018
Regex with sed

hi
i would like to say "DATABASENAME=" to "TABLESNAME="

remove "," and press enter myconfig file
thanks
 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

sed regex

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)
Discussion started by: Shakey21
4 Replies

2. UNIX for Dummies Questions & Answers

using sed and regex to reverse order???

so i have been trying to learn how to manipulate text on my own and have gotten stumped... let's say i have a text file that says (highly simplified): people ordinary How would swap the order of the words.. I know i need to use sed and some kind of back reference but cannot make it... (2 Replies)
Discussion started by: urtherhoda
2 Replies

3. Shell Programming and Scripting

Sed and regex help needed

Hi all, I'm writing a script that replaces a value in a file. The file is formatted as follows: So, for this example, I'd like to replace the value for param_two. The value for param_two can be a one, or two-digit number. It replaces the value in file.cfg, and directs the... (9 Replies)
Discussion started by: marknu1
9 Replies

4. Shell Programming and Scripting

sed - using regex and | need help

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)
Discussion started by: TehOne
2 Replies

5. Shell Programming and Scripting

Converting perl regex to sed regex

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)
Discussion started by: suntzu
1 Replies

6. UNIX for Advanced & Expert Users

Sed regex problem

Hi, I tried to extract the time from `date` with sed. (I know it works with `date +%H:%M:%S` as well) I got three solutions of which just one worked. I thought "+" should repeat the previous expression 1 or more times and {n} should repeat the previous expression n times. $ date Thu... (9 Replies)
Discussion started by: thiuda
9 Replies

7. Shell Programming and Scripting

Use regex in replacement string in SED

Hi, I need to use the regex in the replacement string in SED command. something like sed -e ' s/\(^\{5\}\).\{150\}\(.*\)$/\10\{30\}1\{30\}A\{60\}B\{30\}\2/' abc which means for all the lines in file abc that starts with 5 characters, I need to replace character 6-151... (6 Replies)
Discussion started by: snowline84
6 Replies

8. Shell Programming and Scripting

Question on awk/sed/regex

I plan to do something like this in awk that's embedded in a shell script. I have extracted a text file using awk and the output is before example: <USDOLLARS|xxx> I want to use get rid of the starting "<" and anything after the pipe "|" after example: USDOLLARS How do I do that?? I... (8 Replies)
Discussion started by: deadyetagain
8 Replies

9. Shell Programming and Scripting

Help with sed substitution / regex

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)
Discussion started by: Jedimark
5 Replies

10. Shell Programming and Scripting

Multiple regex in sed

I am using the following sed script to remove new lines (\r\n and \n), except from lines starting with >: sed -i ':a /^>/!N;s/\r\n\(\)/\1/;s/\n\(\)/\1/;ta' Is there a way to include both \r\n and \n in one regex to avoid the second substitute script (s/\n\(\)/\1/)? (4 Replies)
Discussion started by: Xterra
4 Replies
Config::Perl::V(3pm)					 Perl Programmers Reference Guide				      Config::Perl::V(3pm)

NAME
Config::Perl::V - Structured data retrieval of perl -V output SYNOPSIS
use Config::Perl::V; my $local_config = Config::Perl::V::myconfig (); print $local_config->{config}{osname}; DESCRIPTION
$conf = myconfig () This function will collect the data described in "the hash structure" below, and return that as a hash reference. It optionally accepts an option to include more entries from %ENV. See environment below. Note that this will not work on uninstalled perls when called with "-I/path/to/uninstalled/perl/lib", but it works when that path is in $PERL5LIB or in $PERL5OPT, as paths passed using "-I" are not known when the "-V" information is collected. $conf = plv2hash ($text [, ...]) Convert a sole 'perl -V' text block, or list of lines, to a complete myconfig hash. All unknown entries are defaulted. $info = summary ([$conf]) Return an arbitrary selection of the information. If no $conf is given, "myconfig ()" is used instead. $md5 = signature ([$conf]) Return the MD5 of the info returned by "summary ()" without the "config_args" entry. If "Digest::MD5" is not available, it return a string with only 0's. The hash structure The returned hash consists of 4 parts: build This information is extracted from the second block that is emitted by "perl -V", and usually looks something like Characteristics of this binary (from libperl): Compile-time options: DEBUGGING USE_64_BIT_INT USE_LARGE_FILES Locally applied patches: defined-or MAINT24637 Built under linux Compiled at Jun 13 2005 10:44:20 @INC: /usr/lib/perl5/5.8.7/i686-linux-64int /usr/lib/perl5/5.8.7 /usr/lib/perl5/site_perl/5.8.7/i686-linux-64int /usr/lib/perl5/site_perl/5.8.7 /usr/lib/perl5/site_perl . or Characteristics of this binary (from libperl): Compile-time options: DEBUGGING MULTIPLICITY PERL_DONT_CREATE_GVSV PERL_IMPLICIT_CONTEXT PERL_MALLOC_WRAP PERL_TRACK_MEMPOOL PERL_USE_SAFE_PUTENV USE_ITHREADS USE_LARGE_FILES USE_PERLIO USE_REENTRANT_API Built under linux Compiled at Jan 28 2009 15:26:59 This information is not available anywhere else, including %Config, but it is the information that is only known to the perl binary. The extracted information is stored in 5 entries in the "build" hash: osname This is most likely the same as $Config{osname}, and was the name known when perl was built. It might be different if perl was cross-compiled. The default for this field, if it cannot be extracted, is to copy $Config{osname}. The two may be differing in casing (OpenBSD vs openbsd). stamp This is the time string for which the perl binary was compiled. The default value is 0. options This is a hash with all the known defines as keys. The value is either 0, which means unknown or unset, or 1, which means defined. derived As some variables are reported by a different name in the output of "perl -V" than their actual name in %Config, I decided to leave the "config" entry as close to reality as possible, and put in the entries that might have been guessed by the printed output in a separate block. patches This is a list of optionally locally applied patches. Default is an empty list. environment By default this hash is only filled with the environment variables out of %ENV that start with "PERL", but you can pass the "env" option to myconfig to get more my $conf = Config::Perl::V::myconfig ({ env => qr/^ORACLE/ }); my $conf = Config::Perl::V::myconfig ([ env => qr/^ORACLE/ ]); config This hash is filled with the variables that "perl -V" fills its report with, and it has the same variables that "Config::myconfig" returns from %Config. inc This is the list of default @INC. REASONING
This module was written to be able to return the configuration for the currently used perl as deeply as needed for the CPANTESTERS framework. Up until now they used the output of myconfig as a single text blob, and so it was missing the vital binary characteristics of the running perl and the optional applied patches. BUGS
Please feedback what is wrong TODO
* Implement retrieval functions/methods * Documentation * Error checking * Tests AUTHOR
H.Merijn Brand <h.m.brand@xs4all.nl> COPYRIGHT AND LICENSE
Copyright (C) 2009-2013 H.Merijn Brand This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself. perl v5.18.2 2014-01-06 Config::Perl::V(3pm)
All times are GMT -4. The time now is 10:59 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy