Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
このbashコードは、多くのフォルダーが存在する間、フォルダー名を表示しません。
#!/bin/bash for file in .; do if [ -d $file ]; then echo $file fi done
出力はただ. です理由を説明できますか?
.
サイズ1の配列として読み取り.、印刷します。代わりに次のようなものを使用してください。
for file in `ls`; do if [ -d $file ]; then echo $file fi done