| Newsgroups |
gmane.editors.sed.user |
| Message-ID |
<[email protected]> |
Which windows version do you use?
Commandline syntax inside a console window or inside a batch file is
different.
To make things more difficult, commandline syntax to declare a for loop
inside a console window is different to one declared in a batch file.
Furthermore it would be interesting to know, if you use sed in the
declaration line of the loop [ eg. for /n %%a in ('xxx |sed
"DoSomething"') Do (DoSomething)] or if you use sed INSIDE the loop [eg.
for /n %%a in ('xxx') Do (echo x|sed "DoSomething")]. Behaviour here is
different too.
Would you provide a code example of your desired for loop?
And again, should it be executed via console window or inside a batch file?
Am 01.05.2015 um 22:39 schrieb Petr Lázňovský [email protected] [sed-users]:
>> AG [U [Fri, 1 May 2015 12:46:39 -0700]:
> >> PLLC[U [Fri, 1 May 2015 12:38:42 -0700]:
>
> >> > How do I add caret '^' before each comma ',' in text string? Trying
> >> > this:
> >> >
> >> > echo {"errors":{"subject_id":["mandatory","Contact not exist."]}} |
> >> > sed.exe -e "s/,/^,/g"
> >> [...]
>
> >> Try enclosing the entire string in double-quotes or single-quotes,
> >> something like echo "("errors":...}}" | sed ...
>
> >> -Amarendra
>> [...]
>>
>> Actually, not needed. Your first form works as-is on my W2K8 server
>> with GNU sed version 4.2.1.
>>
> I see, it work from cmdline but problem seems arise in FOR loop usage.
>
> Complex issue just posted into alt.msdos.batch.nt if someone interested.
>
> Thank you anyway, L.
>
>
>
>
> ------------------------------------
> Posted by: =?windows-1250?Q?Petr_L=E1z=F2ovsk=FD?= <[email protected]>
> ------------------------------------
>