I tried your option but again it does replaces all the occurences of sun4v but i want to look for that line and replace the occurence only in that line.
[...]
Could you post a sample from your file?
What's your OS and sed version?
Oops, sorry, I had to insert the hole pattern
And, of course (from the FAQ):
Quote:
If you know the pattern *won't* occur on the first line, omit the
first -e and the statement following it.
Last edited by radoulov; 09-25-2007 at 12:44 PM..
Reason: Correction
Hello,
I am hoping someone can provide some guidance on using context based search and replace to search for a pattern and then do a search and replace in the line that follows it. For example, I have a file that looks like this:
<bold>bold text
</italic>
somecontent
morecontent... (3 Replies)
Hi All,
I have a file that I need to be able to find a pattern match on a line, search that line for a text pattern, and replace that text.
An example of 4 lines in my file is:
1. MatchText_randomNumberOfText moreData ReplaceMe moreData
2. MatchText_randomNumberOfText moreData moreData... (4 Replies)
hai
i am very new to unix.
i am having two files like this.
first.properties
cache.ZA.TL_CCY=SELECT trim(CCY_CODE)||trim(COUNTRY_CODE)||trim(CITY_CODE) AS... (4 Replies)
Hi All,
I have a requirement where I have to find a pattern in a file and comment the whole line containing the search pattern. Any ideas in shell is welcome.
Thanks in advance,
Regards,
Arun (3 Replies)
Hi,
I need help. I have XML file as below
<a n="infoLevel">
<v s="true"/>
</a>
<a n="localAddr">
<v s="server.host.com"/>
</a>
<a n="ListenPort">
<v s="21111"/>
</a>
I need to find variable "ListenPort" in line and then replace... (4 Replies)
There appears to be several threads that touch on what I'm trying to do, but nothing quite generic enough.
What I need to do is search through many (poorly coded) HTML files and make changes. The catch is that my search string may be on one line or may be on several lines.
For example there... (5 Replies)
Dear All,
i want to search particular string and want to replance next line value.
following is the test file.
search string is
tmp,???
,10:1 "???" may contain any 3 character it should remain the same and next line replace with ,10:50
tmp,123 --- if match tmp,??? then... (3 Replies)
Hi All,
i can replace a perticular value in sentence using perl.
perl -pi -e 's/old/new/' sample.txt
but i am not able to replace whole string by perl.
file1 contains "jdbc:oracle:thin:@(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=10.147.109.211)(PORT=1526))(CONNECT_DATA=(SID= MWDBD22)))". i... (3 Replies)
I have a file which requires modification via a shell script.
Need to do the following: 0. take input from user for new text. 1. search for a keyword in the file. 2. replace the line next to this to this keyword with user supplied input.
for e.g., my file has the following text:
(some... (7 Replies)
All, I appreciate any help you can offer here as this is well beyond my grasp of awk/sed...
I have an input file similar to:
&LOG
&LOG Part: "@DB/TC10000021855/--F"
&LOG
&LOG
&LOG Part: "@DB/TC10000021852/--F"
&LOG Cloning_Action: RETAIN
&LOG Part: "@DB/TCCP000010713/--A"
&LOG
&LOG... (5 Replies)
Discussion started by: KarmaPoliceT2
5 Replies
LEARN ABOUT XFREE86
getconfig
getconfig(5) File Formats Manual getconfig(5)NAME
getconfig - meta configuration files for getconfig(1)SYNOPSIS
*.cfg
DESCRIPTION
getconfig is a programmatic interface that is used by the XFree86 server to get configuration information about video hardware when operat-
ing without an XF86Config file.
This implementation of getconfig is written in perl. It processes rules from meta-configuration files. All meta-configuration files have
a .cfg suffix.
Lines starting with a pound-sign (#) are comments, and are ignored. Blank lines that consist only of white space are also treated as com-
ments and ignored.
The first non-comment line must be a signature string followed by the file format version number. The signature string is
"XFree86 Project getconfig rules file. Version: "
The currently defined version is "1.0". Files that do not have the correct signature string are ignored.
The remaining non-comment lines define rules. The start of a new rule is indicated by a line with no leading white space. Subsequent
lines making up a rule must be indented with white space. Logical lines within a rule may be split over multiple physical lines by using
the usual continuation convention ('' at the end of the line). The first logical line of each rule is a perl expression. It may be any
valid perl expression whose evaluated (with 'eval') result may be used as the argument to a perl 'if' statement. The second logical line
should be the name of the XFree86 video driver to use when the rule is true, and subsequent logical lines of each rule, if present, are
additional configuration output for the video device's XF86Config Device section. The driver name and additional lines of configuration
information are written to standard output when the rule is chosen as the successful rule.
Pseudo rules consisting of perl expressions may be present in the file for the purpose of defining custom perl variables or setting the
weight to use for the following rules. Pseudo rules are rules that consist of a single logical line only, and they are never candidates
themselves for the successful rule.
Several perl variables are pre-defined, and may be used within rules. They include:
$vendor PCI vendor ID
$device PCI device ID
$revision PCI revision ID
$subsys PCI subsystem ID
$subsysVendor PCI subsystem vendor ID
$class PCI class
$sbuspath SBUS path
$XFree86Version XFree86 version, as a 'v' string
$XFree86VersionNumeric XFree86 numeric version
$XFree86VersionMajor XFree86 major version
$XFree86VersionMinor XFree86 minor version
$XFree86VersionPatch XFree86 patch version
$XFree86VersionSnap XFree86 snap version
$weight current rule weight
The $weight variable determines the weight of the rules as they are processed. The weight for subsequent rules may be set with a pseudo
rule that sets or changes the value of $weight. The default weight, and the weight used for built-in rules is 500. The meta-configuration
files are processed in an unpredictable order. The weighting of the rules is used to determine their relative priority
After processing all of the rules, both built-in and those read from the meta-configuration files, the getconfig program chooses as the
successful rule the last and highest weighted rule that evaluates to true.
FILES
.cfg files located in the search path. The search path typically specified by the XFree86 server is:
/etc/X11
/usr/X11R6/etc/X11
<modulepath>
/usr/X11R6/lib/X11/getconfig
where <modulepath> is the XFree86 server's module search path.
/usr/X11R6/lib/X11/getconfig/xfree86.cfg
Default rules file that gets installed. This file doesn't contain any rules by default.
/usr/X11R6/lib/X11/getconfig/cfg.sample
A sample rules file that gives some examples of what types of rules can appear in rules files.
SEE ALSO getconfig(1), XFree86(1), XF86Config(5).
AUTHORS
The XFree86 automatic configuration support and the getconfig interface was written by David H. Dawes, with the support of X-Oz Technolo-
gies.
XFree86 Version 4.7.0 getconfig(5)