#!/bin/sh # dirlist -- just does a dir listing in gph format DIR=${1:-$PWD} for f in "$DIR"/*; do bn=$(basename "$f") mtime=$(stat -f "%Sm" "$f") if [ "$bn" != "index.gph" ]; then if [ -d "$f" ]; then printf "[1|%-30s$mtime|$bn|server|port]\n" "$bn" else printf "[0|%-30s$mtime|$bn|server|port]\n" "$bn" fi fi done printf "\n[1|<-- Home|/|server|port]\n"