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
Loop problem with one more problem aliahsan81 Shell Programming and Scripting 3 01-07-2009 02:02 AM
problem in finding a hardware problem girish.batra SUN Solaris 8 09-09-2008 10:10 AM
ssh script problem problem pcjandyala Shell Programming and Scripting 2 07-31-2008 03:27 PM
problem with dd command or maybe AFS problem Anta Shell Programming and Scripting 0 08-25-2006 10:10 AM
SSH Problem auth problem budrito UNIX for Advanced & Expert Users 1 03-17-2004 10:12 AM

Closed Thread
English Japanese Spanish French German Portuguese Italian Dutch Swedish Russian Norwegian Hungarian Hebrew Danish
 
LinkBack Thread Tools Search this Thread Rate Thread Display Modes
  #1 (permalink)  
Old 11-07-2008
aliahsan81 aliahsan81 is offline
Registered User
  
 

Join Date: Sep 2008
Posts: 62
Sed Problem

I have a file which contain many lines see below.

"/var/www/abc>"

I want to remove Both of these values
"" and >
  #2 (permalink)  
Old 11-07-2008
zaxxon's Avatar
zaxxon zaxxon is offline Forum Staff  
Moderator
  
 

Join Date: Sep 2007
Location: Germany
Posts: 2,257
Code:
echo '"/var/www/abc>"'| tr -d '">'
/var/www/abc
  #3 (permalink)  
Old 11-07-2008
demwz demwz is offline
Registered User
  
 

Join Date: Jun 2008
Posts: 128
echo '"/var/www/abc>"' | tr -d "\"|>"
oops - someone was quicker
  #4 (permalink)  
Old 11-07-2008
aliahsan81 aliahsan81 is offline
Registered User
  
 

Join Date: Sep 2008
Posts: 62
Thx

But i did a typo mistake file contain these line,and many more but some what different from each other.
"/var/www/abc">
"/var/www/xyz">

So i only need sed to do the job if possible.
  #5 (permalink)  
Old 11-07-2008
zaxxon's Avatar
zaxxon zaxxon is offline Forum Staff  
Moderator
  
 

Join Date: Sep 2007
Location: Germany
Posts: 2,257
Why not use tr? You can use sed, right, but why not tr?

Code:
root@isau02:/data/tmp/testfeld> cat infile
"/some/path/whatever/weekend">
"/var/www/abc">
"/var/www/xyz">
"/is/close/noting/can/stop/it">
"/really">
root@isau02:/data/tmp/testfeld> tr -d '">' < infile
/some/path/whatever/weekend
/var/www/abc
/var/www/xyz
/is/close/noting/can/stop/it
/really
root@isau02:/data/tmp/testfeld> sed 's/[">]//g' infile
/some/path/whatever/weekend
/var/www/abc
/var/www/xyz
/is/close/noting/can/stop/it
/really
  #6 (permalink)  
Old 11-07-2008
aliahsan81 aliahsan81 is offline
Registered User
  
 

Join Date: Sep 2008
Posts: 62
No problem with tr but i like sed
Sponsored Links
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 03:30 PM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited. Language translation by Google.
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