With sed replaced special character is printed twice, why?


Login or Register to Reply

 
Thread Tools Search this Thread
# 8  
Old 5 Days Ago
For the record: GNU sed is available on Windows(UnxUtils contains GNU sed 4.0.7) and works fine with that problem. For downloads see links above.

Code:
sed -r "s#([0-9]{6})#     \"get /LADIDADI/ds01005/\1\" ^#" test.txt

This User Gave Thanks to stomp For This Post:
SIEMI (5 Days Ago)
# 9  
Old 5 Days Ago
Maybe something else generates a trailing ^ ?
Try to omit it in the sed:
Code:
sed "s#\([0-9][0-9][0-9][0-9][0-9][0-9]\)#     \"get /LADIDADI/ds01005/\1\" #"

This User Gave Thanks to MadeInGermany For This Post:
SIEMI (5 Days Ago)
# 10  
Old 5 Days Ago
Hi SIEMI..

As stomp has already quoted there is also CygWin.

It is a reliable *NIX-alike terminal _emulator_ for want of a better word.
It has a very large subset of tools/utilities that we expect of the UNIX environment.
AFAIK the tools/utilities are GNU compatible.
The terminal is called 'mintty' and also has a very large subset of terminal escape codes too.

There is an excellent package list for it though for anything not installed by default:

Cygwin Package List

However there are foibles.
  • It IS SLOW doing tasks compared to its REAL counterparts. It can be debilitatingly slow at times.
  • Some tools/utilities are not available from a DEFAULT install, bc, dc and hexdump were three of those but may well be implemented now.
  • I always feel Windows itself gets in the way as in writing to STDOUT seems very slow compared to a REAL *NIX environment like OSX 10.14.x, or Linux.
  • If you like attacking the HW, then don't expect an immediate response. '/dev/dsp' IS available but if you call it there could be up to a second or more delay before it starts. This is what I mean about Windows getting in the way.
This User Gave Thanks to wisecracker For This Post:
SIEMI (5 Days Ago)
Login or Register to Reply

|
Thread Tools Search this Thread
Search this Thread:
Advanced Search

More UNIX and Linux Forum Topics You Might Find Helpful
sed command to add special character (') anshu ranjan Shell Programming and Scripting 8 09-08-2016 04:44 PM
sed add special character stinkefisch Shell Programming and Scripting 7 09-01-2016 09:37 AM
Replacing special character with sed gotamp UNIX for Dummies Questions & Answers 3 03-08-2016 11:16 AM
How to replace special character using sed? vivien_chu Shell Programming and Scripting 1 10-15-2012 09:31 AM
How to substitute variable in sed for special character? vinothsekark Shell Programming and Scripting 9 04-29-2012 06:39 AM
how to replace the special character with another using SED mohan.bit Shell Programming and Scripting 2 02-01-2011 05:59 PM
sed special character replace toor13 Shell Programming and Scripting 3 01-20-2011 11:57 AM
How to print range of lines using sed when pattern has special character "[" nehashine Shell Programming and Scripting 3 05-06-2010 04:13 AM
Decode %s Special Character in Sed wasabihowdi Shell Programming and Scripting 2 02-15-2010 05:19 AM
Deleteing one character after an special character mohsin.quazi Shell Programming and Scripting 1 10-20-2009 04:27 PM
Special Character SED/AWK removal Raggedranger333 Shell Programming and Scripting 6 02-26-2009 03:07 PM
special character tostay2003 Shell Programming and Scripting 4 01-06-2009 08:07 PM
Sed-Special character replacement usshell Shell Programming and Scripting 3 05-22-2008 10:06 AM
sed and special character in data MizzGail Shell Programming and Scripting 3 01-23-2008 02:45 PM
Special characters getting replaced by &Pound in Unix Environment kaushik05 UNIX for Advanced & Expert Users 0 09-23-2005 01:10 AM