Muilti Entry Sed


 
Thread Tools Search this Thread
Top Forums UNIX for Dummies Questions & Answers Muilti Entry Sed
# 1  
Old 03-13-2004
Lightbulb Muilti Entry Sed

My defaul shell is /bin/ksh

I want to make multi entry sed changes to files
mainly because is easier for me to check my arguments in that
format, than all in just one line. example

sed '
> s/this/for this/
> s/that/for that/
> s/I/me/' filex > filez

Searching the net I read this works for /bin/sh
but is a pain to be changing shell all the time

Tony
tony3101
# 2  
Old 03-13-2004
.....

Last edited by druuna; 05-21-2009 at 10:14 AM..
druuna
# 3  
Old 03-13-2004
Re: Muilti Entry Sed

Quote:
Originally posted by tony3101
Searching the net I read this works for /bin/sh
but is a pain to be changing shell all the time
Works in ksh too.
 
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. UNIX for Beginners Questions & Answers

Awk/sed summation of one column based on some entry in first column

Hi All , I am having an input file as stated below Input file 6 ddk/djhdj/djhdj/Q 10 0.5 dhd/jdjd.djd.nd/QB 01 0.5 hdhd/jd/jd/jdj/Q 10 0.5 512 hd/hdh/gdh/Q 01 0.5 jdjd/jd/ud/j/QB 10 0.5 HD/jsj/djd/Q 01 0.5 71 hdh/jjd/dj/jd/Q 10 0.5 ... (5 Replies)
Discussion started by: kshitij
5 Replies

2. Shell Programming and Scripting

sed command to add a new column entry

My input file looks like this 12 3 5.122.281.413 172.31.15.220 3421 4133 2 2 1454 3421 4133 2 2 0 12 44036 214.215.52.146 90.123.245.211 2312 3911 4 4 521 2312 3911 4 4 1 14 504 6.254.324.219 192.61.27.120 4444 5611 7 5 1415 4444 5611 7 5 1 ... (2 Replies)
Discussion started by: sampitosh
2 Replies

3. Shell Programming and Scripting

How to replace multiple "&nbsp;" entry with in <td> tag into single entry using sed?

I have the input file like this. Input file: 12.txt 1) There are one or more than one <tr> tags in same line. 2) Some tr tags may have one <td> or more tna one <td> tags within it. 3) Few <td> tags having "<td> &nbsp; </td>". Few having more than one "&nbsp;" entry in it. <tr> some td... (4 Replies)
Discussion started by: thomasraj87
4 Replies

4. How to Post in the The UNIX and Linux Forums

Help me, write a bash script to delete parent entry with all their child entry in LDAP UNIX server

Hi All, Please help me and guide me to write a bash/shell script on Linux box to delete parent entry with all their child entries. example: Parent is : ---------- dn: email=yogesh.kumar@wipro.com, o=wipro, o=in child is: ---------- dn: cn: yogesh kumar, email=yogesh.kumar@wipro.com,... (1 Reply)
Discussion started by: Chand
1 Replies

5. Shell Programming and Scripting

Replacing specific entry using sed

Hi guys, I'm new to bash programming, so please pardon me. I'm trying to replace an entry's text in Books.txt This code works perfectly: sed -i "s/$BookTitle/$NewBookTitle/g" Books.txt But problem is, if there are double entries, it will also replace that entry. For example: ... (12 Replies)
Discussion started by: todaealas
12 Replies

6. Shell Programming and Scripting

sed remove cron entry

Hello, I am not having much luck with removing a entry in cron. I would like to get rid of the following line in /var/spool/cron/root. 1 09 * * 1-5 /etc/init.d/snmpd stop > /dev/null 2>&1I have tried this with no luck. sed -i 's#1 09 * * 1-5 /etc/init.d/snmpd stop >... (3 Replies)
Discussion started by: jaysunn
3 Replies

7. Shell Programming and Scripting

parse xm entry with awk/sed

Hi folks, I have XML files with the following sections (section occurs once per file) in them: <AuthorList CompleteYN="Y"> <Author ValidYN="Y"> <LastName>Bernal</LastName> <ForeName>Federico</ForeName> ... (3 Replies)
Discussion started by: euval
3 Replies

8. Shell Programming and Scripting

Using regex in sed to validate the length of an entry

I'm having trouble using sed to validate the length of an entry. I want to have a user enter a phone number of either length 7, 10 or 11. Only numbers are allowed. Does anyone know how to do this? Here's the code I have so far. It only validates that numbers are entered but not the length. ... (1 Reply)
Discussion started by: snag49ers
1 Replies

9. Shell Programming and Scripting

delete dhcp.conf entry using sed

I am trying to use sed to remove entries from my dhcpd.conf file. The form of the file is: host foo { option 1 option 2 } host bar { option 1 option 2 } I was trying to use a label like: sed -e :a -e "s/^host bar {*//g;/{/N;//ba" /etc/dhcpd.conf... (2 Replies)
Discussion started by: tizatron
2 Replies

10. Shell Programming and Scripting

Crontab entry

Hello, I am trying to schedule a job to run every 15 minutes from 7am to 5:30pm. Could someone show me the syntax for this? Thanks. (1 Reply)
Discussion started by: bestbuyernc
1 Replies
Login or Register to Ask a Question