Grepでは、input_file_nameは0です。

Grepでは、input_file_nameは0です。

マニュアルでは、grepgrepの使い方の一般的な形式は次のとおりです。

grep options pattern input_file_names

特に、「0個以上の入力ファイル名があるかもしれません」と明記されています。

ファイル名が0の場合、どのファイルが検索候補ですか?前任者。grep mystr

ベストアンサー1

~からman grep:

   file   A pathname of a file to be searched for the patterns. If no file
          operands are specified, the standard input shall be used.

したがって、関連するパイプやリダイレクトがない場合は、ユーザーがテキストを入力するのを待ちます。

おすすめ記事