#!/bin/bash path=$1 caption=$2 if [ -z "${caption}" ]; then caption="$(basename "$path" | sed 's/-/ /g; s/\.[^.]*$//')" fi echo "
$caption
$caption
"