重定向符(、)的使用
- 作者: 陪她i
- 来源: 51数据库
- 2021-07-28
(1)、拷贝文件:
type file1 〉file2 ;产生 file2 文件
type file1 〉〉file2 ;在 file2 文件后追加
(2)、建立文件:
echo numline = 10 〉starts.bas
echo for i = 1 to numline 〉〉starts.bas
echo thestr = ""〉〉starts.bas
echo for j = 1 to 2 * i - 1 〉〉starts.bas
echo thestr = thestr + "*"〉〉starts.bas
echo next 〉〉starts.bas
echo ? space(numline - i) + thestr 〉〉starts.bas
echo next 〉〉starts.bas
(3)、输出到打印机:
copy starts.bas 〉prn
或 copy starts.bas 〉lpt1
type file1 〉file2 ;产生 file2 文件
type file1 〉〉file2 ;在 file2 文件后追加
(2)、建立文件:
echo numline = 10 〉starts.bas
echo for i = 1 to numline 〉〉starts.bas
echo thestr = ""〉〉starts.bas
echo for j = 1 to 2 * i - 1 〉〉starts.bas
echo thestr = thestr + "*"〉〉starts.bas
echo next 〉〉starts.bas
echo ? space(numline - i) + thestr 〉〉starts.bas
echo next 〉〉starts.bas
(3)、输出到打印机:
copy starts.bas 〉prn
或 copy starts.bas 〉lpt1
推荐阅读
