Dear all,
I was wondering If you could help me out.
I Am using a batch script to midfy some text files.
Input:
912856
912857
912904
Amongst others I use this line:
REM I want to replace all lines that start with a 6-digit Number with a ftp command "get" followed by a path and the 6-digit number.
call N:\Tools\sed.exe "s/\([0-9][0-9][0-9][0-9][0-9][0-9]\)/ \"get \/LADIDADI\/ds01005\/\1\" ^/"
I can't reproduce the behaviour that you show. With "sed (GNU sed) 4.5" it just prints one caret ^ , not an escaped plus an unescaped caret, which I presume is exactly what you want.
Is that a cygwin (or similar) on a windows system? I don't know the peculiarities of that implementation... any chance to deploy another version / tool?
Thanks, but I still get the same result.
What I try to do is to create an FTP Batch File that transfers only a limited list of folders.
I use WinScp for the connection and now I fail in editing the "get" commands for each line which I need to end with the ^ character so the next line is interpreted.
I added two images. one shows the files I want to edit and the the is the result of my sed command.
If you can't change tools, I'm afraid you have to experiment. Does that duplication happen to other characters as well? Does it happen in the last position only? Is it an output artifact only, perhaps? Can you remove the last character by an additional sed command?
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:
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.