+ -
当前位置:首页 → 问答吧 → 关于重定向输出!!!!!!!!!!!!!!!!!!!!

关于重定向输出!!!!!!!!!!!!!!!!!!!!

时间:2011-11-10

来源:互联网

请问各位 有什么办法 把输出 > 到一个还未创建的文件中去吗?

比如 read $PASSWD > newfile 

这个newfile 不存在,输出之后 自动创建这个文件 。

作者: zs25611818   发布时间: 2011-11-10

问题是这样的 > 输出到文件之后 提示 no such file or directory!

作者: zs25611818   发布时间: 2011-11-10

Perl code

#!/bin/sh
read input
echo $input > newfile

作者: delphiwcdj   发布时间: 2011-11-10

引用 2 楼 delphiwcdj 的回复:

Perl code

#!/bin/sh
read input
echo $input > newfile



请问如果我想让这个 read 里输入的东西 不可见 怎么做?

比如 su 到其他用户时输入的密码是不可见的 我应该如何设置?

作者: zs25611818   发布时间: 2011-11-10

-s 试试

作者: delphiwcdj   发布时间: 2011-11-10