回答編集履歴
1
Update
test
CHANGED
@@ -1,7 +1,9 @@
|
|
1
1
|
`data` ディレクトリがあるディレクトリで当該のスクリプトを実行するのだとすれば以下の様になるのではないでしょうか。また、「期待する結果」と同じ出力にするには 6 文字目で判定する必要があるかと思います。
|
2
2
|
```bash
|
3
3
|
for dir1 in data/*;do
|
4
|
+
test -d "${dir1}" || continue
|
4
5
|
for dir2 in ${dir1}/*;do
|
6
|
+
test -d "${dir2}" || continue
|
5
7
|
dir2=$(basename "${dir2}")
|
6
8
|
five="${dir2:5:1}"
|
7
9
|
if [ "$five" = "1" ];then
|