Important Notice: Our web hosting provider recently started charging us for additional visits, which was unexpected. In response, we're seeking donations. Depending on the situation, we may explore different monetization options for our Community and Expert Contributors. It's crucial to provide more returns for their expertise and offer more Expert Validated Answers or AI Validated Answers. Learn more about our hosting issue here.

See also section 4.10, “How do I handle shell quoting in sed?

quoting section SED Shell
0
Posted

See also section 4.10, “How do I handle shell quoting in sed?

0

4.8.2. – on MS-DOS and 4DOS platforms Under 4DOS and MS-DOS version 7.0 (Win95) or 7.10 (Win95 OSR2), environment variables can be accessed from the command prompt. Under MS-DOS 6.22 and below, environment variables can only be accessed from within batch files. Environment variables should be enclosed between percent signs and are case-insensitive; i.e., %USER% or %user% will display the USER variable. To generate a true percent sign, just enter it twice. DOS versions of sed require that sed scripts be enclosed by double quote marks “…” (not single quotes!) if the script contains embedded tabs, spaces, redirection arrows or the vertical bar. In fact, if the input for sed comes from piping, a sed script should not contain a vertical bar, even if it is protected by double quotes (this seems to be bug in the normal MS-DOS syntax). Thus, echo blurk | sed “s/^/ |foo /” # will cause an error sed “s/^/ |foo /” blurk.txt # will work as expected Using DOS environment variables which contain D

Related Questions

Thanksgiving questions

*Sadly, we had to bring back ads too. Hopefully more targeted.