03-04-2010
AWK or SED to add string at specific position
Greetings.
I don't have experience programing scripts. I need to
insert a string in a specific position of another string on another file (last.cfg), for example:
File
last.cfg before using script:
login_interval=1800
lcs.machinename=client04
File
last.cfg after using script:
login_interval=1800
lcs.machinename=newclient04
I read about awk and sed comands, by I'm not sure what use and how.
Please, I'll thank so much if someone may help me or tell me if this problem has been solve on another post.
Vanesuke
10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
Hi All,
I would like to use sed to add "-" between the following string:
Value: 20060830
Result: 2006-08-30
Pls advice. Thx a lot
Victor (5 Replies)
Discussion started by: victorlung
5 Replies
2. Shell Programming and Scripting
Hi, guys. I have one question:
How can I search for a line with certain string in it and then insert a string into this line?
For example:
There is a file called shadow, the contents of it are below:
**************************
...
yuanz:VIRADxMsadfDF/Q:0:0:50:7:::... (9 Replies)
Discussion started by: daikeyang
9 Replies
3. Shell Programming and Scripting
I am trying to use sed to replace specific characters at a specific position in the file with a different value... can this be done?
Example:
File:
A0199999123
A0199999124
A0199999125
Need to replace 99999 in positions 3-7 with 88888.
Any help is appreciated. (5 Replies)
Discussion started by: programmer22
5 Replies
4. Shell Programming and Scripting
My source is on each line
98.194.245.255 - - "GET /disp0201.php?poc=4060&roc=1&ps=R&ooc=13&mjv=6&mov=5&rel=5&bod=155&oxi=2&omj=5&ozn=1&dav=20&cd=&daz=&drc=&mo=&sid=&lang=EN&loc=JPN HTTP/1.1" 302 - "-" "Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.1; Trident/4.0; .NET CLR 1.0.3705; .NET CLR... (5 Replies)
Discussion started by: elamurugu
5 Replies
5. Shell Programming and Scripting
I want to remove text from nth position to nth position couple of times in same line
my line is
"hello is there anyone can help me with this question"
I need like this
ello is there anyone can help me with question
'h' is removed and 'this' removed from the line. I want to do this... (5 Replies)
Discussion started by: elamurugu
5 Replies
6. Shell Programming and Scripting
I woud like to substitue a string on a specific position for specific lines
I've got a file and I would like to change a specific string from "TOCHANGE" to "ABCABCAB"
For every line (except 1,2, 3 and the last one) , I need to check between the 9th and the 16th digits.
For the 3rd line, I... (7 Replies)
Discussion started by: BSF
7 Replies
7. Shell Programming and Scripting
I'm drawing a blank on how to use sed to replace selectively based on position in the string (vs nth occurence):
hello.|there.|how.|are.|you.|
I want the period removed in the 3rd item (as defined by the pipe delimiter) if a period is present. So the result in this case would be:
... (2 Replies)
Discussion started by: tiggyboo
2 Replies
8. Shell Programming and Scripting
I asked this before, but my problem got more complicated. Heres what I am trying to do:
I'm trying to replace a string at a certain location with another string.
Heres the file I'm trying to change:
\E
I want to replace the escape code at the 3rd line, 2nd column with this escape code... (3 Replies)
Discussion started by: tinman47
3 Replies
9. Shell Programming and Scripting
here is what i want to achieve... consider a file contains below contents. the file size is large about 60mb
cat dump.sql
INSERT INTO `table1` (`id`, `action`, `date`, `descrip`, `lastModified`) VALUES (1,'Change','2011-05-05 00:00:00','Account Updated','2012-02-10... (10 Replies)
Discussion started by: vivek d r
10 Replies
10. Shell Programming and Scripting
Trying to combine strings that are a partial match to another in $1 (usually below it). If a match is found than the $2 value is added to the $2 value of the match and the $3 value is added to the $3 value of the match. I am not sure how to do this and need some expert help. Thank you :).
file
... (2 Replies)
Discussion started by: cmccabe
2 Replies
LEARN ABOUT OPENSOLARIS
ser.cfg
ser.cfg(5) Sip Express Router ser.cfg(5)
NAME
ser.cfg - ser configuration file
SYNOPSIS
/etc/sfw/ser/ser.cfg
DESCRIPTION
ser reads the configuration data from /etc/sfw/ser/ser.cfg (or the file specified with -f on the command line). The file contains global
configuration parameters, module loading commands and the script that will be executed for each received request. Lines starting with # or
enclosed in /* ... */ are interpreted as comments.
This manual page is incomplete. For further information please read the Ser User Guide (http://www.iptel.org/ser/admin.html).
FILES
/etc/sfw/ser/ser.cfg
AUTHORS
Andrei Pelinescu - Onciul, <pelinescu-onciul@fokus.gmd.de>
Bogdan Andrei Iancu
Daniel-Constantin Mierla
Jan Janak
Jiri Kuthan
Juha Heinanen
Maxim Sobolev
Miklos Tirpak
Nils Ohlmeier
Ramona-Elena Modroiu
Raphael Coeffic
Ricardo Baratto
Stelios Sidiroglou-Douskos
SEE ALSO
ser(8)
Full documentation on ser, including configuration guidelines, FAQs and licensing conditions, is available at http://www.iptel.org/ser/.
For reporting bugs see http://www.iptel.org/ser/bugs/.
Mailing lists:
serusers@iptel.org - ser user community
serdev@iptel.org - ser development, new features and unstable version
For help/support, write an email to <serhelp@iptel.org>.
ATTRIBUTES
See attributes(5) for descriptions of the following attributes:
+--------------------+--------------------+
| ATTRIBUTE TYPE | ATTRIBUTE VALUE |
+--------------------+--------------------+
|Availability | SUNWserr, SUNWseru |
+--------------------+--------------------+
|Interface Stability | External |
+--------------------+--------------------+
NOTES
Source for ser is available on http://opensolaris.org.
ser 15.07.2002 ser.cfg(5)