The UNIX and Linux Forums  

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
get rid of special characters vakharia Mahesh UNIX and Linux Applications 4 07-29-2008 02:36 PM
How to find special characters?? sumitc AIX 3 05-04-2008 09:20 PM
Grep with Special Characters Vashj Shell Programming and Scripting 6 11-27-2007 06:51 AM
special characters nawnaw UNIX for Dummies Questions & Answers 2 05-18-2004 04:17 PM
awk/sed with special characters apalex Shell Programming and Scripting 5 05-06-2002 05:40 PM

 
English Japanese Spanish French German Portuguese Italian Dutch Swedish Russian Norwegian Hungarian Hebrew Danish Bulgarian Greek Powered by Powered by Google
 
LinkBack Thread Tools Search this Thread Rate Thread Display Modes
Prev Previous Post   Next Post Next
  #1 (permalink)  
Old 04-06-2009
itzz.me itzz.me is offline
Registered User
  
 

Join Date: Apr 2009
Posts: 5
sed with special characters

Hi,

I am reading a file (GC_JAR.log) which has entries like:

511725.629, 0.1122672 secs]
525268.975, 0.1240036 secs]
527181.835, 0.2068215 secs]
527914.287, 0.2884801 secs]
528457.134, 0.2548725 secs]


I want to replace all the entries of "secs]" with just "secs"

Thus, the output should be like:

511725.629, 0.1122672 secs
525268.975, 0.1240036 secs
527181.835, 0.2068215 secs
527914.287, 0.2884801 secs
528457.134, 0.2548725 secs


I tried using sed but it's not working for some reason. I read line by line from the original file ( GC_JAR.log ) and dump the final output in GC_cycles.csv

# !/bin/bash
SOURCE=secs\]
TARGET=secs
cat GC_JAR.log | while read line
do
echo "${line}" | sed 's/"${SOURCE}"/"${TARGET}"/g' >> GC_cycles.csv
done


Any ideas please? what's going wrong with sed command there.
 

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 11:37 AM.


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