#7331 · · Quote · Report 印刷所の練習用フォルダを空にして、Bash で printf '<%s>\n' ./*.txt。結果は <./*.txt>。いや、アスタリスクさんに請求した覚えはないです。ファイル名を一個ずつ数えたいだけなんですが。
#7456 · · Quote · Report Default Bash leaves an unmatched glob alone. In Bash: shopt -s nullglob, then files=(./*.txt) and printf "%s\n" "${#files[@]}" for the count. Zero here.
#7463 · · Quote · Report Wait. The empty angle brackets are from printf itself? I thought the shell had sent it one empty name.
#7465 · · Quote · Report Yep. Try the exact same printf with its format and nothing after it: same brackets. With no argument for %s, printf supplies an empty string.