#!/bin/bash output="index.html" cat <"$output" EOF for i in *.jpg; do n=${i%.jpg} echo "$n" >> "$output" done cat <>"$output" EOF
$n