中国DOS联盟论坛

China DOS Union

-- Unite DOS · Advance DOS · Grow DOS --
Union site: www.cn-dos.net Forum site: www.cn-dos.net/forum
Guest | Log in | Register | Members | Search | China DOS Union
中国DOS联盟论坛
The time now is 2026-08-03 08:56
48,038 topics / 350,123 posts / today 0 new / 48,251 members
DOS批处理 & 脚本技术(批处理室) » How to compile a command to return to the carriage with debug?
Printable Version  3,128 / 16
Floor1 yaotoo1024 Posted 2006-12-15 12:57
新手上路 Posts 6 Credits 16
May I ask all the experts how it is achieved
Floor2 redtek Posted 2006-12-15 22:28
金牌会员 Posts 1,147 Credits 2,902
Why do we need to compile a command for carriage return? I don't understand what the brother means?
Floor3 yaotoo1024 Posted 2006-12-16 00:18
新手上路 Posts 6 Credits 16
I want to put the result of the previous command into the second command, and the result of one command is a carriage return. I don't know how to implement this carriage return.
Floor4 lxmxn Posted 2006-12-16 00:35
版主 Posts 4,938 Credits 11,386

  You can easily solve it using the pipe symbol.

  For example: echo cn-dos|find "cn"
Floor5 redtek Posted 2006-12-16 00:36
金牌会员 Posts 1,147 Credits 2,902
You can use the pipe "|" operation to "give" the result of the previous command to the second command for "receiving" ~:)

Specific operations also depend on what the previous command is? (Is it the output of a batch process or the output after a command is executed).
Also depends on what the next command is (is it something like FTP that can receive commands from a text file, or can receive parameters, etc....)
Floor6 yaotoo1024 Posted 2006-12-16 00:52
新手上路 Posts 6 Credits 16
The result of the previous command is a carriage return. How is this carriage return implemented? The next command needs to have a carriage return in the middle to be implemented.
Floor7 redtek Posted 2006-12-16 01:25
金牌会员 Posts 1,147 Credits 2,902
The command that needs to be followed by a carriage return after echo.|
Floor8 electronixtar Posted 2006-12-16 02:16
铂金会员 Posts 2,672 Credits 7,493
Using prompts is also okay
Floor9 a9319751 Posted 2006-12-16 05:19
中级用户 Posts 170 Credits 439
Try the runas command. This command must enter the password. I tried using | but it didn't work.
Floor10 yaotoo1024 Posted 2006-12-16 06:36
新手上路 Posts 6 Credits 16
The problem is solved. Just use echo.| This is okay. Thank you everyone.
Floor11 anqing Posted 2007-02-01 22:52
高级用户 Posts 413 Credits 859
Using the pipe symbol can easily solve it.

For example: echo cn-dos|find "cn" This only displays cn-dos, why does it also produce a carriage return?
Floor12 redtek Posted 2007-02-01 23:12
金牌会员 Posts 1,147 Credits 2,902
That carriage return is sent by the Echo command ~:)

If it's like the following, there won't be a carriage return. It waits for you to give a carriage return to indicate the input is complete (confirmation) before it continues to execute ~:)

set /p=cn-dos|find "cn"
Floor13 anqing Posted 2007-02-01 23:37
高级用户 Posts 413 Credits 859
Is this the ASCII code for the carriage return in cn-dos?
Floor14 anqing Posted 2007-02-01 23:44
高级用户 Posts 413 Credits 859
echo cn-dos returns also have an empty line?
Floor15 redtek Posted 2007-02-01 23:46
金牌会员 Posts 1,147 Credits 2,902
Echo cn-dos|find "cn"

Pass the pipe to find to receive...
The string "cn-dos" sent by this Echo is received by find: "63 6E 2D 64 6F 73 0D" (in fact, everything the computer sees is binary, and hexadecimal is used for programming, understanding, and visual convenience), and the last 0D represents the carriage return character, which is sent by Echo to indicate the end of a line :)

Examples of pipeline programming and BASIC demonstrations come from the Microsoft website:
http://support.microsoft.com/kb/46376/zh-cn

[ Last edited by redtek on 2007-2-1 at 10:48 AM ]
1 2  Next
[ Contact the Union admin team - 中国DOS联盟 - Standard version ]
Sponsored by ifanr Inc | © 2001–2023