I need to replace the line containing "STAGE_DB" with the line
"STAGE_DB $DB # database that contains the table being loaded ($workingDB)"
Here $DB is passed during the runtime.
How can I do this?
Thanks,
Kousikan (2 Replies)
New to sed...
Have a file foo.txt (below).
Need to replace text on 2 lines, but can only feed sed the first few characters of each line (all lines are unique).
So, in my example, I have put '$' in place of what I need to figure out how to feed the whole line.
What I have thus far:
sed -e... (6 Replies)
Hi,
I am looking for any script which can do the following.
have to read a pattern from fileA and copy it to fileB.
fileA:
...
...
Header
...
...
..p1
...
...
fileB:
....
....
Header (3 Replies)
I have a pattern
username:x:32005:32006::/usr/local/user:/bin/bash
I need to match the line containing username and replace /bin/bash with /usr/local/my/bin/noshell
So it becomes
username:x:32005:32006::/usr/local/user:/usr/local/my/bin/noshell (7 Replies)
I have a file with multiple lines like this:
<junk><PATTERN><junk><PATTERN><junk>
<junk><PATTERN><junk><PATTERN><junk><PATTERN><junk>
Note that
1. There might be variable number occurrences of PATTERN in a line.
2. <> are just placeholders, they do not form part of the pattern.
I need... (4 Replies)
Sed replace using same pattern repeating multiple times in a line
I have text like below in a file:
I am trying to replace the above line to following
How can I acheive this?
I am able to do it if the occurrence is for 1 time:
But If I try like below
I am getting like this:
I have to... (4 Replies)
awk , sed Experts,
I want to remove first and last line after pattern match "vg" :
I am trying : # sed '1d;$d' works fine , but where the last line is not having vg entry it is deleting one line of data.
- So it should check for the pattern vg if present , then it should delete the line ,... (5 Replies)
Im using the command below , but thats not the output that i want. it only prints the odd and even numbers.
awk '{if(NR%2){print $0 > "1"}else{print $0 > "2"}}'
Im hoping for something like this
file1:
Text hi this is just a test
text1 text2 text3 text4 text5 text6
Text hi... (2 Replies)
I am trying to combine lines with these conditions:
1. First line starts with text of "libname VALUE db2 datasrc" where VALUE can be any text.
2. If condition1 is met then continue to combine lines through a line that ends with a semicolon.
3. Ignore case when matching patterns and remove any... (5 Replies)
Discussion started by: Wes Kem
5 Replies
LEARN ABOUT MOJAVE
locale::codes::langfam
Locale::Codes::LangFam(3pm) Perl Programmers Reference Guide Locale::Codes::LangFam(3pm)NAME
Locale::Codes::LangFam - standard codes for language extension identification
SYNOPSIS
use Locale::Codes::LangFam;
$lext = code2langfam('apa'); # $lext gets 'Apache languages'
$code = langfam2code('Apache languages'); # $code gets 'apa'
@codes = all_langfam_codes();
@names = all_langfam_names();
DESCRIPTION
The "Locale::Codes::LangFam" module provides access to standard codes used for identifying language families, such as those as defined in
ISO 639-5.
Most of the routines take an optional additional argument which specifies the code set to use. If not specified, the default ISO 639-5
language family codes will be used.
SUPPORTED CODE SETS
There are several different code sets you can use for identifying language families. A code set may be specified using either a name, or a
constant that is automatically exported by this module.
For example, the two are equivalent:
$lext = code2langfam('apa','alpha');
$lext = code2langfam('apa',LOCALE_LANGFAM_ALPHA);
The codesets currently supported are:
alpha
This is the set of three-letter (lowercase) codes from ISO 639-5 such as 'apa' for Apache languages.
This is the default code set.
ROUTINES
code2langfam ( CODE [,CODESET] )
langfam2code ( NAME [,CODESET] )
langfam_code2code ( CODE ,CODESET ,CODESET2 )
all_langfam_codes ( [CODESET] )
all_langfam_names ( [CODESET] )
Locale::Codes::LangFam::rename_langfam ( CODE ,NEW_NAME [,CODESET] )
Locale::Codes::LangFam::add_langfam ( CODE ,NAME [,CODESET] )
Locale::Codes::LangFam::delete_langfam ( CODE [,CODESET] )
Locale::Codes::LangFam::add_langfam_alias ( NAME ,NEW_NAME )
Locale::Codes::LangFam::delete_langfam_alias ( NAME )
Locale::Codes::LangFam::rename_langfam_code ( CODE ,NEW_CODE [,CODESET] )
Locale::Codes::LangFam::add_langfam_code_alias ( CODE ,NEW_CODE [,CODESET] )
Locale::Codes::LangFam::delete_langfam_code_alias ( CODE [,CODESET] )
These routines are all documented in the Locale::Codes::API man page.
SEE ALSO
Locale::Codes
The Locale-Codes distribution.
Locale::Codes::API
The list of functions supported by this module.
http://www.loc.gov/standards/iso639-5/id.php
ISO 639-5 .
AUTHOR
See Locale::Codes for full author history.
Currently maintained by Sullivan Beck (sbeck@cpan.org).
COPYRIGHT
Copyright (c) 2011-2013 Sullivan Beck
This module is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
perl v5.18.2 2013-11-04 Locale::Codes::LangFam(3pm)