The (unofficial) documentation for Internal CMD ECHO
shows some interesting tricks. However, I have not yet found a way to echo a single character .
Quick note, od
used below from a Git (or Gow) installation
For example, this will affect 'a'
with the new line 'windows' ( \r\n
):
>echo a| od -A x -t x1z -v - 000000 61 0d 0a >a..< 000003
And this trick (also in the docs now) doesn't hear anything:
><nul (set/p _any_variable=)| od -A x -t x1z -v - 000000
So, I would expect this to only reflect "a":
><nul (set/p _any_variable=a)| od -A x -t x1z -v - 000000 61 20 >a < 000002
But it adds extra space at the end.
Is it possible to just make one character?
@Aacini answered correctly (first question) in the comment below , but in case he does not create an answer, here he is:
>set /P "=a" < NUL | od -A x -t x1z -v - 000000 61 >a< 000001
And are there any tricks to get a more accurate one, such as UNIX ECHO
with -n
(no new line) and -e
( use backslash interpretation ), so I could with similar conclusions:
>unix_echo -n -e "a\n" | od -A x -t x1z -v - 000000 61 0a >a.< 000002