Create html for imgs in a folder using filename as alt in bash
This scripts generates the html code for all the images in a folder. It will use the filename, without extension and with some mods, as Alt attribute for the image.
#!/bin/bash
PATH_WWW="/img";
EXT="jpg"
for i in *.$EXT; do
fname=$(basename $i .jpg);
fname=${fname/_/ };
fname=${fname/-/ };
fname=${fname/./ };
echo "<img src="$PATH_WWW/$i" alt="$fname" />";
done