#!/bin/sh . bin/func set -e current_date=$(date +"%a, %d %b %Y %H:%M:%S %z") uname=$(uname) cat <<-EOF > "${rss_out_file}" ${website_title} ${website_description} ${website_link} $(date +"%Y") ${website_title} - All rights reserved ${website_email} ${website_email} ${current_date} ${current_date} ${website_generator} ${website_language} https://validator.w3.org/feed/docs/rss2.html 1800 EOF for file in $(__list_files_date "${rss_dir}"); do title=$(__get_value_title "${file}") date=$(__get_value_date_publication "${file}") link="${website_link}/$(__get_final_filename ${file})" if [ "${uname}" = "Linux" ]; then guid="$(echo ${link} | sha256sum | cut -d ' ' -f 1)" else guid="$(echo ${link} | sha256)" fi cat <<-EOF >> "${rss_out_file}" ${title} ${link} ${date} ${guid} EOF done cat <<-EOF >> "${rss_out_file}" EOF