1 | #!/bin/sh |
---|
2 | |
---|
3 | dr=$(pwd) |
---|
4 | [ -n "$1" ] && dr=$1 |
---|
5 | #LIST /$dr |
---|
6 | if ls -1 /$dr >/dev/null 2>&1 ; then |
---|
7 | lsopts="-lan" |
---|
8 | if ls -Q /$dr >/dev/null 2>/dev/null; then |
---|
9 | lsopts=$lsopts"Q" |
---|
10 | fi |
---|
11 | ls $lsopts /$dr 2>/dev/null | grep '^[^cbt]' | ( |
---|
12 | while read p l u g s m d y n; do |
---|
13 | echo "P$p $u.$g |
---|
14 | S$s |
---|
15 | d$m $d $y |
---|
16 | :${n} |
---|
17 | " |
---|
18 | done |
---|
19 | ) |
---|
20 | ls $lsopts /$dr 2>/dev/null | grep '^[cb]' | ( |
---|
21 | while read p l u g a i m d y n; do |
---|
22 | echo "P$p $u.$g |
---|
23 | E$a$i |
---|
24 | d$m $d $y |
---|
25 | :${n} |
---|
26 | " |
---|
27 | done |
---|
28 | ) |
---|
29 | echo '### 200' |
---|
30 | else |
---|
31 | echo '### 500' |
---|
32 | fi |
---|