Escape characters on right side of pipe

Feb 23, 2012
240
3
This query is actually an offshoot of different thread (http://jpsoft.com/forums/threads/how-do-i-give-this-command.3797/), because I think that the essential issue there was not addressed or discussed fully.
The TCC help file notes:
"WARNING: Escape characters are considered to be normal characters on the right side of a pipe."
I would like to clarify two things about this warning:

1] This behavior is only consistent when there is no command that follows the pipe. However, if we add an additional pipe afterward, then the escape characters to the right of the pipe *are* treated as escape characters, as demonstrated here:

[C:\]echo "foo" | echoargs ^q^q^q
Arg 0 is <^q^q^q>
[C:\]echo "foo" | echoargs ^q^q^q | findstr ">"
Arg 0 is <">

In the first example, the ^q chars are treated as literals to the right of the pipe. In the second example, although they are to the right of the pipe, they are to the left of an additional pipe, and they are treated as escape characters.

Similarly, if we execute:
echo "foo" | echoargs > a.txt ^q^q^q
Then a.txt contains: Arg 0 is <">

Here too, although they are to the right of the pipe, they are treated as escape characters because there is a redirection afterwards (although the redirection is physically noted to their left, it is logically executed afterward).

WAD? At the least, the docs should be clarified. But overall the behavior seems inconsistent.

2] Additionally, I would note that in cmd.exe, at least in today's versions, the escape character is *not* ignored at the right of a pipe; thus, when it comes to such constructions, behavior will be different under cmd.exe and under TCC. What is the rationale behind this discrepancy?
 
Similar threads
Thread starter Title Forum Replies Date
D Regexes and escape characters Support 5
vefatica ECHOERR and color escape sequences Support 4
P Escape key no longer clears command line in v24 Support 21
D Can ANSI escape sequences be used in keystroke aliases? Support 8
jbanaszczyk How to escape? Support 2
tmaynard How to? Control-U alias for Escape (command line editing) Support 5
H Escape key no longer closes Help Support 3
M Escape-character issue... Support 7
vefatica Escape sequences and DO? Support 13
R WAD Unusable state when using Chinese characters Support 3
C TEE command appending null characters to output Support 6
vefatica Quoting file names with special characters? Support 7
vefatica How to? Add real <ESC> characters with TPIPE Support 2
C Erase all characters left or right from cursor location Support 2
J Escaped Characters and Variables Support 2
Joe Caverly Unicode, Codepage 437, and line characters Support 3
gschizas Fixed Using codepage 65001 (UTF-8) breaks non-ASCII characters Support 8
vefatica Display of special characters in aliases. Support 25
J Python: TCC command line parsing removes '=' equal sign characters Support 4
C filemasks over 172 characters fail Support 5
redwdc TCC.exe opens to 11 characters x 3 rows Support 1
G Selection characters with mouse double-click Support 3
R Function #IDOW returns only 2 characters Support 10
krischik WAD Tee printing Chinese characters Support 7
Alexander How to? how can I use Cyrillic characters in the Echo command? Support 8
jadaml Echo unicode characters from UTF-8 Batch files? Support 1
V Fixed CD ~ has trash characters in it Support 5
S International characters - TYPE vs %@LINE function Support 5
Jay Sage Getting Quote Characters into a Toolbar Tab Support 12
vefatica Fixed Escaping special characters Support 1
M Problem with Extended Search and non-ASCII characters in directories names Support 3
A How to? PhraseExpress autotext/autocompletion printing unexpected characters Support 4
thedave WAD Unable to type various characters using Windows 8's onscreen keyboard Support 7
JohnQSmith WAD DO and escaped redirect characters Support 6
W TCMD 16: double characters Support 11
MickeyF how to work with env var with special characters in the name Support 5
vefatica Fixed TPIPE doesn't /SPLIT at characters Support 0
J How to? 'tab' characters in the console and clipboard 'copy' Support 1
M How to? Determine a whether vars beginning with certain characters exist... Support 5
M Another simple question re. Take Command/TCC window witdth in characters... Support 16
U Keystack mangles 'special' characters Support 6
J dir failure with some unicode characters Support 6
vefatica Random access to the characters in a string? Support 4
nikbackm @select function and TAB characters Support 1
M Overriding meanings of some characters... Support 7
T How do you echo lines with special characters to file? Support 4
Emilio III Control characters pass through? Support 6
S Strange REN problem - non-English characters Support 3
nikbackm Output of non-ascii characters via pipe Support 1
K Processing strings with % characters? Support 2

Similar threads