OverviewThis article describes the basic concepts for html generation with the linux dash command interpreter.
The dash command line interpreter can be used to generate video player websites for each video in a directory.
Example: Video Collection
|Example Video Collection|
Use the for-command to loop through every file. The example below loops through all mp4-files.
for - loop through files
for filename in *.mp4;do echo $filename; done
The for-command can also be used to generate video thumbnails and background-images with a video formats converter.
Use the while-command to loop through every line of a file. The example below will read the html template file template.html and loop trough all its lines and replace the SSI-variable *VARIABLE* by the dash variable $variable. In this example the output file is vidcenter.html.
while - loop through code lines
while read line;do
line=$(echo $line | sed "s/\*VARIABLE\*/$variable/")
echo $line >> "vidcenter.html"
done < "template.html"