#! /bin/sh set -eu if [ "$#" -ne 1 ] && [ "$#" -ne 2 ]; then echo "Usage: $0 []" exit 1 fi if [ "$#" -eq 1 ]; then suffix="index.html" else suffix="${2}" fi o="$1/.tmp_index_$$" rm -f "$o" echo '" >> "$o" mv -f "$o" "$1"/index.html