此用于管道结果和搜索大写字母的命令不起作用。收到 "no such file or directory" 错误

This command to pipe results and search for uppercase letters is not working. Getting "no such file or directory" error

我正在做作业,有一部分说要放入这个命令,它应该通过管道传输结果并搜索大写字母。

这是它说要输入的命令:

grep -E "[a-z]" rawpassword.txt | grep – E "[A-Z]" >passwd.txt

但是每当我放入它时,我都会收到错误“[A-Z]”:没有这样的文件或目录。

是不是命令有错别字之类的?

建议 1:

  grep "[a-z]" rawpassword.txt | grep  "[A-Z]" >passwd.txt

建议 2:

  awk '/[a-z]/ && /[A-Z]/' rawpassword.txt >passwd.txt