|  | 
 
| qingteng1983 新手上路
 
  
 
 
 
 积分 6
 发帖 2
 注册 2006-11-24
 状态 离线
 | 
| 『楼 主』:
 有谁知道Dos的重定向命令<和<<的用法?
 
使用 LLM 解释/回答一下 
 
 
虽然资料上都是它能够从文件中读取东西,但都没有示例。我现在有一个文本文件,里面只有一个数字。我现在想将它读取出来,赋值给一个变量。该如何做?我试了这样set var=<a.txt不行。
 
 希望能提供点思路或者资料!
 
Although the materials all say that it can read things from files, there are no examples. Now I have a text file with only one number. I want to read it out and assign it to a variable. How to do it? I tried set var=<a.txt, which doesn't work. Hope to get some ideas or materials! 
 
 
 |  | 
|  2006-11-24 09:51 |  | 
|  | 
 
| bailang3106 初级用户
 
   
 
 
 
 积分 36
 发帖 19
 注册 2007-12-29
 状态 离线
 | 
| 『第 2 楼』:
 
 
使用 LLM 解释/回答一下 
 
 
帮忙顶下. 我也想知道怎么做. 论坛里多是>的. 
Help to top up. I also want to know how to do it. Most of the things in the forum are >. 
 
 
 |  | 
|  2008-9-19 14:17 |  | 
|  | 
 
| wwmmc 初级用户
 
   
 
 
 
 积分 35
 发帖 62
 注册 2008-10-12
 状态 离线
 | 
| 『第 3 楼』:
 
 
使用 LLM 解释/回答一下 
 
 
">" ">>"都是输出重定向
 不过">>"是把所要输出的内容接着 文档的尾部
 如:
 @echo off
 dir > d:\1.txt
 pause
 
 @echo off
 dir >> d:\1.txt
 pause
 
 你看下有什么区别就知道了
 
">" and ">>" are both output redirections. However, ">>" appends the content to be output to the end of the document. For example:
 @echo off
 dir > d:\1.txt
 pause
 
 @echo off
 dir >> d:\1.txt
 pause
 
 You can see the difference by having a look.
 
 
 
 |  | 
|  2008-11-27 16:15 |  | 
|  | 
 
| HAT 版主
 
         
 
 
 
 积分 9023
 发帖 5017
 注册 2007-5-31
 状态 离线
 | 
| 『第 4 楼』:
 
 
使用 LLM 解释/回答一下 
 
 
建议到批处理室提问 
It is suggested to ask questions in the Batch Processing Room 
 
 
 
 |  
                  |  
  |  | 
|  2008-11-27 17:22 |  | 
|  | 
 
| DOSforever 金牌会员
 
       
 
 
 
 积分 4639
 发帖 2239
 注册 2005-1-30
 状态 离线
 |  | 
|  2008-11-27 19:59 |  | 
|  | 
 
| alchemist 高级用户
 
     
 
 
 积分 652
 发帖 193
 注册 2005-9-25
 状态 离线
 | 
| 『第 6 楼』:
 
 
使用 LLM 解释/回答一下 
 
 
<是输入重定向,提供软件内部的应答dir.txt内容只有一个字节是 D
 比如 xcopy adir bdir < dir.txt
 在提示
 Does 2 specify a file name
 or directory name on the target
 (F = File, D = directory)
 的回答中,"D"便自动成为答案是复制继续
 
< is input redirection, providing the internal response of the software. The content of dir.txt has only one byte which is D. For example, xcopy adir bdir < dir.txt. When prompted "Does 2 specify a file name or directory name on the target (F = File, D = directory)", the answer "D" will automatically become the answer and the copy continues. 
 
 
 
 |  
                  |  ディスケット  オペレーティン  グシステム
 |  | 
|  2008-11-28 21:39 |  | 
|  | 
 
| alchemist 高级用户
 
     
 
 
 积分 652
 发帖 193
 注册 2005-9-25
 状态 离线
 | 
| 『第 7 楼』:
 
 
使用 LLM 解释/回答一下 
 
 
Originally posted by wwmmc at 2008-11-27 16:15:">" ">>"
 都是输出重定向
 不过">>"是把所要输出的内容接着 文档的尾部
 如:
 @echo off
 dir > d:\1.txt
 pause
 
 @echo off
 ...
 
输出重定向">"还有几个用途,如 
dir > PRN 
是把dir输出的内容直接打在打印机上(只能用LPT口的打印机) 
而下面 
pkunzip aa.zip c:\tools > nul 
表示在给aa.zip解压缩中不输出解压信息 
Originally posted by wwmmc at 2008-11-27 16:15:">" ">>"
 Both are output redirections
 However, ">>" appends the content to be output to the end of the document
 For example:
 @echo off
 dir > d:\1.txt
 pause
 
 @echo off
 ...
 
There are several other uses for the output redirection ">", such as 
dir > PRN 
This sends the content output by dir directly to the printer (only printers using the LPT port) 
And the following 
pkunzip aa.zip c:\tools > nul 
This means no decompression information is output during the decompression of aa.zip 
 
 
 
 |  
                  |  ディスケット  オペレーティン  グシステム
 |  | 
|  2008-11-28 21:43 |  | 
|  | 
 
| Qtwdftxvt 初级用户
 
   
 
 
 积分 190
 发帖 101
 注册 2008-11-23
 状态 离线
 | 
| 『第 8 楼』:
 
 
使用 LLM 解释/回答一下 
 
 
">"是输出;">>"是追加;"<"是输入。 
">" is output; ">>" is append; "<" is input. 
 
 
 |  | 
|  2008-11-28 21:56 |  | 
|  | 
 
| earth123xinyuan 社区乞丐
 
 
 
 
 
 积分 -46
 发帖 25
 注册 2009-2-9
 来自 内蒙
 状态 离线
 | 
| 『第 9 楼』:
 
 
使用 LLM 解释/回答一下 
 
 
希望有高手举几个例子 
Hope there are some experts to give a few examples 
 
 
 |  | 
|  2009-2-10 13:45 |  | 
|  | 
 
| pujihong123 初级用户
 
   
 
 
 积分 47
 发帖 27
 注册 2008-6-23
 来自 甘肃. 武威
 状态 离线
 | 
| 『第 10 楼』:
 
 
使用 LLM 解释/回答一下 
 
 
带回去Google一下下! 
Take it back and Google it a bit! 
 
 
 
 |  
                  |  好好学习,
 天天向上。
 |  | 
|  2009-2-12 22:35 |  |