no the sed command without -i does not work either.
sed: can't read \remoteHostc$log.info: No such file or directory
---------- Post updated at 10:07 PM ---------- Previous update was at 03:30 PM ----------
Tried sed "s/aaa/bbb/g"
\\remoteHost\c$\log.info >
\\remoteHost\c$\temp\log.txt
Substitution was successful but
\\remote...\temp\log.txt contained all the lines in log.info minus the newlines. All of the content in log.txt was in a single line...
---------- Post updated 01-13-11 at 11:38 AM ---------- Previous update was 01-12-11 at 10:07 PM ----------
After running sed "s/aaa/bbb/g"
\\remoteHost\c$\log.info >
\\remoteHost\c$\temp\log.txt
I noticed that notepad displayed log.txt file contents in one line. It appears that wehn the file is modified from the cygwin shell, it adds both the carriage return and newline between the lines instead of just the newlines.
How can I edit a file on the remote windows server in place and have just newlines inserted between the lines ?
Thanks.
---------- Post updated at 11:49 AM ---------- Previous update was at 11:38 AM ----------
I piped the output of "s/aaa/bbb/g"
\\remoteHost\c$\log.info to sed 's/$`"/\\r/" and that took care of converting Unix style newlines to dos format.
However now I save the output in a temporary file on the windows server and then use xcopy to copy it ot the original file.
I would like to avoid this and edit the file in place. Any suggestions ?
Thanks.