The UNIX and Linux Forums  
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.

Go Back   The UNIX and Linux Forums > Top Forums > Shell Programming and Scripting
.
google unix.com



Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts and shell scripting languages here.

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
syntax error: unexpected end of file Alaeddin Shell Programming and Scripting 10 10-20-2008 07:09 AM
awk Shell Script error : "Syntax Error : `Split' unexpected Herry UNIX for Dummies Questions & Answers 2 03-17-2008 11:16 AM
sh: syntax error: `...' unexpected??? alan Shell Programming and Scripting 5 06-22-2004 06:58 PM
sh: syntax error at line 1: `>' unexpected atiato High Level Programming 2 03-16-2004 07:39 AM
syntax error: `(' unexpected adadevil UNIX for Dummies Questions & Answers 11 12-14-2001 09:17 PM

Closed Thread
English Japanese Spanish French German Portuguese Italian Dutch Swedish Russian Norwegian Hungarian Hebrew Danish Powered by Powered by Google
 
LinkBack Thread Tools Search this Thread Rate Thread Display Modes
  #1 (permalink)  
Old 12-04-2008
phpfreak phpfreak is offline
Registered User
  
 

Join Date: Feb 2008
Posts: 50
sed error : Syntax error: redirection unexpected

My script is throwing the error 'Syntax error: redirection unexpected'

My line of code..

Code:
cat nsstatustest.html | sed s/<tr><td align="left">/<tr><td align="left" bgcolor="#000000"><font color="white">/ > ztmp.Ps23zp2s.2-Fpps3-wmmm0dss3
HTML tags are getting in the way but they're needed to keep from replacing other parts of the code within the page. I know I'll need on of the ",', or ` but I'm not sure where. Please help.
  #2 (permalink)  
Old 12-04-2008
Christoph Spohr Christoph Spohr is offline
Registered User
  
 

Join Date: Sep 2008
Posts: 205
Hi,

first you don't need cat. You can invoke sed and give it a filename a parameter.

Sed syntax is:

Code:
sed 's///' file
If your search-replace-string contains "/", you have to escape them.

HTH Chris
  #3 (permalink)  
Old 12-04-2008
phpfreak phpfreak is offline
Registered User
  
 

Join Date: Feb 2008
Posts: 50
Yes, I'm aware of both but as you can see in my example, it doesn't contain "/". It's html code. I'll try with putting the segments of html code in ", ', ` or as I've just learned with one of the delimiters :,_, or |

I'll come back to this later once I find out
  #4 (permalink)  
Old 12-04-2008
phpfreak phpfreak is offline
Registered User
  
 

Join Date: Feb 2008
Posts: 50
just figured it out.. used the delimiter _ then \< \>
Closed Thread

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On




All times are GMT -4. The time now is 04:00 PM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited. Language Translations Powered by .
vBCredits v1.4 Copyright ©2007 - 2008, PixelFX Studios
The UNIX and Linux Forums Content Copyright ©1993-2009. All Rights Reserved.Ad Management by RedTyger

Content Relevant URLs by vBSEO 3.2.0