condense multiple steps


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting condense multiple steps
# 1  
Old 01-27-2011
condense multiple steps

Can I do multiple passes in one step?
Code:
sed    's/<FONT face='\''Arial'\'' size='\''3'\''>//'  $file > tmpfile.html ; mv tmpfile.html $file
sed    's/<FONT face='\''Courier'\'' size='\''3'\''>//'  $file > tmpfile.html ; mv tmpfile.html $file
sed    's/<\/FONT>//'    $file > tmpfile.html ; mv tmpfile.html $file
sed    's/<table border=0>/<table border=1 width=95%>/'              $file > tmpfile.html ; mv tmpfile.html $file

I tried:
Code:
sed    's/<FONT face='\''Arial'\'' size='\''3'\''>//'        \
sed    's/<FONT face='\''Courier'\'' size='\''3'\''>//'     \
sed    's/<\/FONT>//'                                                \
sed    's/<table border=0>/<table border=1 width=95%>/'              $file > tmpfile.html ; mv tmpfile.html $file

but that wasn't correct. Should I pipe them ?
# 2  
Old 01-27-2011
You can use -e
Code:
sed -e 's/pattern1//' -e 's/pattern2//' file


Last edited by Scrutinizer; 01-27-2011 at 10:17 AM..
# 3  
Old 01-27-2011
TY, again !!
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Solaris

Live upgrade first steps

Hello Guys, I am a little confused about the first step in the live upgrade process. I will be glad if someone can clarify this for me. The pre-live upgrade patch, when do you add this patch to the OS you want to upgrade? 1. before creating the new boot environment? or 2. after creating... (1 Reply)
Discussion started by: cjashu
1 Replies

2. Shell Programming and Scripting

sed command to condense two lines into one

My eyes glaze over trying to understand multiline sed commands, so please forgive me if this has been asked before. I'd like to condense the following two lines: fooPATTERN1 PATTERN2bar into the following one line: foobar How is that done in sed? (7 Replies)
Discussion started by: scolfax
7 Replies

3. UNIX for Dummies Questions & Answers

New install, how to capture the steps?

Hi All, I am working on a new server Dell which I need to install RH version 6.1. I need to document every thing I do on this server, how do I capture screen shot as I do the install? I used to work on Sun Solaris, I can do this by connecting on COM port after that I had the console access... (2 Replies)
Discussion started by: samnyc
2 Replies

4. AIX

Steps to remove the hacmp

Hi We got a two node active passive hacmp cluster. All of a sudden we got a requirement to remove the hacmp and use the passive node for another application. Hence we need to remove the hacmp and use the nodes as stand alone nodes henceforth? What are the steps to be followed for destroying the... (2 Replies)
Discussion started by: samsungsamsung
2 Replies

5. Shell Programming and Scripting

Need to condense numerous IF/ELSE/FI statements into one if possible.

Hi there! Have literally just started using UNIX bash shell again and am writing simple scripts in VI. I basically have a working script but I know without a doubt it could be condensed down to much less code by integrating the individual IF statements. Here is my shoddy code :) ... (5 Replies)
Discussion started by: U_C_Dispatj
5 Replies

6. Shell Programming and Scripting

First steps in Perl

Hello, I want to start learning Perl, but I need some expert's advice:) Could you recommend me any online manual or book to start with? I have some experience with bash and C, so I am not a complete newbie in programming. What's your advise to start with? Thank you very much for your answers! ... (5 Replies)
Discussion started by: tsurko
5 Replies

7. Solaris

Steps toward Solaris Administration

Dear All, I am currently working as Unix Operator. I am looking forward for Unix Solaris Administration. I need everyone's guidance on this forum, please advice me from where should i start. well i have already installed Solaris version on X86. So please let me know what should i do to become... (9 Replies)
Discussion started by: imrankhan.in
9 Replies

8. HP-UX

modifying start up steps

I tried search and didn't see anything - if there is a thread please point me to it - I want to add a couple of statements to the start up steps basically to touch a file and set the owner & group on it. I want this to happen every start-up. I haven't had sysadm class since HP-UX 9.x and I... (1 Reply)
Discussion started by: LisaS
1 Replies

9. IP Networking

Subnetting in 11 steps

As seen on Digg.com, here is my ip addressing article in full... Original Subnetting in 11 Steps article Subnetting in 11 Steps There are a few things that you will need to know first. I personally use 11 rules that I learned from Mike Vana. Below you will find the 11 rules as well as... (1 Reply)
Discussion started by: jking2100
1 Replies

10. Solaris

steps to ufsrestore

Hello Folks, I have to restore from remote tape sun solaris 10. It has to have mirror raid. I have to restore /,/usr, /var,/opt, /etc,/u01. Could you please give me detailed steps to do the above? I am new to solaris Thanks Ram (1 Reply)
Discussion started by: vr76413
1 Replies
Login or Register to Ask a Question