1 个不稳定版本
| 0.1.0 | 2022年7月31日 |
|---|
#33 在 #tee
8KB
153 代码行
#rustee
rust实现具有更多功能的Unix tee
rustee 0.1.0
Pipe stdin to stdout and file
USAGE:
rt [OPTIONS] [FILE]
ARGS:
<FILE> Output file
OPTIONS:
-a, --append Append the output to the file rather than overwriting
-d, --debug Debug
-h, --help Print help information
-i, --ignore Ignore the SIGINT signal
-n, --noenv Don't consider RUSTEE_MODE environment variable
-u, --unique Pipe only unique lines (won't make existing lines unique in the file)
-V, --version Print version information
$ yes | rt out.txt 截断文件,输出到out.txt
$ yes | rt -a out.txt 将输出追加到out.txt
$ yes | rt -au out.txt 将唯一行追加到out.txt(它只会追加文件中不存在的行)
RUSTEE_MODE 环境变量可用于默认行为。请在您的 ~/.bashrc 或 ~/.zshrc 文件中添加以下内容
RUSTEE_MODE=a:与 -a 选项相同
RUSTEE_MODE=u:与 -u 选项相同
RUSTEE_MODE=au:与 -au 选项相同
-n 标志可以在运行程序时使用,以忽略 RUSTEE_MODE 环境变量
依赖项
~6–16MB
~188K SLoC