Sponsored Content
Top Forums Shell Programming and Scripting How to get a string between two delimeters using sed. Post 302502009 by alister on Sunday 6th of March 2011 01:41:23 PM
Old 03-06-2011
Code:
sed 's/.*(//; s/).*//'

Code:
awk -F '[()]' '{print $2}'

Regards,
Alister
This User Gave Thanks to alister For This Post:
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

sed problem - replacement string should be same length as matching string.

Hi guys, I hope you can help me with my problem. I have a text file that contains lines like this: 78 ANGELO -809.05 79 ANGELO2 -5,000.06 I need to find all occurences of amounts that are negative and replace them with x's 78 ANGELO xxxxxxx 79... (4 Replies)
Discussion started by: amangeles
4 Replies

2. Shell Programming and Scripting

awk with two delimeters

Hi, can anyone explain me below codes...i used the below one to use two delimeter(://) at a time.. but i am not able to understand the output options.. note: here there is no requirement ..only to understand myself about below command... command: awk -F "" '{print $1}' inputfile ... (2 Replies)
Discussion started by: Shahul
2 Replies

3. Shell Programming and Scripting

awk with column delimeters

Hi All, I want to execute this cat /etc/passwd | awk -F: '{print $1,$7}' with a fixed column on the first and second. Say on the first I want 12 column and second with 20 column. Example root /usr/bin/ksh lp /bin/false Thanks for any comment you may add. (5 Replies)
Discussion started by: itik
5 Replies

4. Shell Programming and Scripting

Using sed to replace a string in file with a string in a variable that contains spaces

Hi, i call my shell like: my_shell "my project name" my script: #!/bin/bash -vx projectname=$1 sed s/'PROJECT_NAME ='/'PROJECT_NAME = '$projectname/ <test_config_doxy >temp cp temp test_config_doxy the following error occurres: sed s/'PROJECT_NAME ... (2 Replies)
Discussion started by: vivelafete
2 Replies

5. Shell Programming and Scripting

Commas within Delimeters

Hi experts, I would like a favour from you guys to get the info from 5th column which was separated by the delimeter comma ( , ) The Data file is as below:- 1,USER1,"90, TEST AVENUE, OLD ROAD",test1,124,N 2,USER2,88 TEST STREET NEW ROAD,test2,123,N The User File is as below:- USER1... (1 Reply)
Discussion started by: shenkz
1 Replies

6. Shell Programming and Scripting

replace (sed?) a string in file with multiple lines (string) from variable

Can someone tell me how I can do this? e.g: a=$(echo -e wert trewt ertert ertert ertert erttert erterte rterter tertertert ert) How do i replace the STRING with $a? I try this: sed -i 's/STRING/'"$a"'/g' filename.ext but this don' t work (2 Replies)
Discussion started by: jforce
2 Replies

7. Shell Programming and Scripting

sed or awk command to replace a string pattern with another string based on position of this string

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

8. Shell Programming and Scripting

Lines between specific delimeters

Hi, I have a requirement like this Line 1 Line 2 Line 3 Manager Line 4 Line 5 I have to print like this Have you done your work on time because I have to forward the work forward. Any Help is really Appriciated.... (1 Reply)
Discussion started by: abhishek7687
1 Replies

9. Shell Programming and Scripting

Replace string in XML file with awk/sed with string from another

Sorry for the long/weird title but I'm stuck on a problem I have. I have this XML file: </member> <member> <name>TransactionID</name> <value><string>123456789123456</string></value> </member> <member> <name>Number</name> ... (9 Replies)
Discussion started by: cozzin
9 Replies

10. Shell Programming and Scripting

Replace last 9 delimeters “,” with “|” in UNIX

Hi Guys, I want to replace last 9 "," delimeters with "|" in a file Example :- "ashu,pant",3,5,5,7,7,87,8,8,8 "ashu,pant"|3|5|5|7|7|87|8|8|8 Help would be really appreciated. Thanks guys, Please use CODE tags as required by forum rules! (7 Replies)
Discussion started by: himanshupant
7 Replies
protocols.map(4)					     Kernel Interfaces Manual						  protocols.map(4)

NAME
protocols.map - Specifies node names for protocols configured on your machine. SYNOPSIS
/var/adm/sendmail/protocols.map DESCRIPTION
This file contains the Phase IV, Phase V, UUCP, and X25 node names for your system if the respective protocols are running on your machine. The format of the file is as follows: protocols?Phase_IV_name?Phase_V_name?UUCP_name?X25_name. The string between the delimeters (?) is empty if a particular protocol is not running on your machine. If no protocols are running on your machine, the file contains the follow- ing string: protocols???? If you are generating the hostname.m4 configuration file manually, you must update the protocols.map file manually as well. If your system is a member of a TruCluster Server cluster, you must maintain or create the protocols.map file as a Context-Dependent Symbolic Link (CDSL). See the System Administration guide for more information. In addition, your hostname.m4 configuration file is instead named after the cluster alias, i.e., cluster_alias.m4. The following parame- ters in the hostname.m4 file affect the protocols.map file: If you have defined or updated this parameter in your hostname.m4 file, you must specify the UUCP_name parameter in the protocols.map file. Use your system's UUCP host name. If you have defined or updated this parameter in your hostname.m4 file, you must specify the Phase_IV_name parameter in the protocols.map file. Also, if you have defined any nicknames for DECnet PhaseIV node name in the _My Nicknames parameter of your hostname.m4 file, you must add them to the protocols.map file below the protocols entry as follows: phaseiv: nickname If you enter more than one nickname, put a space between each nickname. You also need to add your DECnet PhaseIV node address as follows: phaseivaddr: address If you have defined or updated this parameter in your hostname.m4 file, you must specify the Phase_V_name parameter in the protocols.map file. Also, if you have defined any nicknames for DECnet PhaseV node name in the _My Nicknames parameter of your hostname.m4 file, you need to add them to the protocols.map file below the protocols entry as follows: phasev: nickname If you enter more than one nick- name, put a space between each nickname. If you have defined or updated this parameter in your hostname.m4 file, you must specify the X25_name parameter in the protocols.map file. Use your system's unqualified node name. RELATED INFORMATION
Commands: sendmail(8) Files: sendmail.cf(4), sendmail.m4(8) Network Administration delim off protocols.map(4)
All times are GMT -4. The time now is 01:10 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy