9 expr "$1" : "$2" >/dev
/null
13 while expr "${!1}" : ".*//" >/dev
/null
; do
14 eval "$1=\${$1//\/\//\/}"
16 [ "${!1: -1}" = / ] && eval "$1=\${$1:0:\$[\${#$1}-1]}"
25 find -L "$iterroot" -type d | \
26 while read scandir
; do
29 echo "<a name=\"$scandir\"></a>"
35 #for dir in ${wd:1}; do
36 for dir
in $scandir; do
37 if [ -z "$dir" ]; then
39 parents
="<a href='#/'>/</a>"
41 if [ "$parent" = / ]; then
44 parent
="$parent${parent:+/}$dir"
46 parents
="$parents${parents:+/}<a href='#$parent'>$dir</a>"
50 echo "<tr><td colspan=$colspan><h2>$parents</h2></td></tr>"
52 if cd "$scandir"; then
58 [ "$f" = .
] && continue
59 if [ "$f" = ..
]; then
60 #stat -c "<tr><td>%A</td><td class=numeric>%h</td><td>%U</td><td>%G</td><td class=numeric>%s</td><td>%y</td><td><a href=\"#$pwd\">${f}</a></td></tr>" "./$f" 2>/dev/null
65 l
=$
(readlink
-n -e "./$f")
66 is_fs_loop
"$l" "$base" && href
="#$l"
68 fields
=($
(stat
-c "%A %h %U %G %s %Y" "./$f" 2>/dev
/null
))
69 fields
[5]=`date -d@${fields[5]}`
70 printf "<tr><td>%s</td><td class=numeric>%s</td><td>%s</td><td>%s</td><td class=numeric>%s</td><td>%s</td><td><a href=\"%s\">%s</a></td></tr>\n" "${fields[@]}" "$href" "$f"
75 if [ ! -d "$f" ]; then
76 fields
=($
(stat
-c "%A %h %U %G %s %Y" "./$f" 2>/dev
/null
))
77 fields
[5]=`date -d@${fields[5]}`
78 printf "<tr><td>%s</td><td class=numeric>%s</td><td>%s</td><td>%s</td><td class=numeric>%s</td><td>%s</td><td>%s</td></tr>\n" "${fields[@]}" "$f"
83 # if [ "$f" != . -a "$f" != .. -a -d "$f" ]; then
84 # if [ -L "$f" ] && is_fs_loop "$(readlink -n -e "./$f")" "$base"; then
95 echo "<tr><td colspan=$colspan><i>Can't change directory: $scandir</i></tr>"
105 <meta http-equiv='Content-Type' content='text/html; charset=UTF-8' />
108 border: 1px solid black;
111 tr:not(:first-child):hover td {
112 background: lightblue;
115 text-decoration: none;
117 tr:first-child a:hover {
118 background: lightblue;
129 td:first-child:not([colspan]) {
130 letter-spacing: -1.5pt;
131 font-family: monospace;
136 td:not(:last-child) {
147 while [ -n "$1" ]; do
148 base
=$
(readlink
-n -f "$1")
155 echo "<p align=right><hr>Made by <em>ls2html</em>.</p>