小编man*_*e00的帖子

重定向到文件,包括当前提示行

如何将重定向命令本身包含到输出文件重定向中?例如

echo "hello!">output.txt
Run Code Online (Sandbox Code Playgroud)

我想要这样的输出文件的内容:

echo "hello!">output.txt
hello!
Run Code Online (Sandbox Code Playgroud)

io-redirection

4
推荐指数
3
解决办法
1694
查看次数

grep regexp [AZ] 返回数字

我有a.txt其内容的文件

1 (C##2)
2 (C##U)
Run Code Online (Sandbox Code Playgroud)

并使用grep

cat a.txt | grep '##[A-Z]*'    
1 (C##2)    
2 (C##U)
Run Code Online (Sandbox Code Playgroud)

为什么1 (C##2)这个 grep 结果中会出现数字?我只想出现第二个。所以我指定了[A-Z]. 为什么它被..##2视为比赛?

grep

0
推荐指数
1
解决办法
227
查看次数

标签 统计

grep ×1

io-redirection ×1