![]() |
|
|
google unix.com
|
|||||||
| Forums | Register | Forum Rules | Links | Albums | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| 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 |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
||||
|
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 |
| Display Modes | Rate This Thread |
|
|