Projet

Général

Profil

Flux rss script » createrss.sh

script qui crée le fichier xml - Grégoire DORIN, 06/03/2023 14:39

 
#!/bin/bash

echo "" > rss.xml

tail -n +2 rss.xml > rss.tmp && mv rss.tmp rss.xml

echo "<?xml version=\"1.0\" encoding=\"UTF-8\"?>" >> rss.xml
echo "<rss version=\"2.0\">" >> rss.xml
echo " <channel>" >> rss.xml
echo " <title>le flux</title>" >> rss.xml
while read line
do
echo " <item>" >> rss.xml
echo " <title>$line</title>" >> rss.xml
echo " <link>$line</link>" >> rss.xml
echo " </item>" >> rss.xml
done < sortlink.txt

echo " </channel>" >> rss.xml
echo "</rss>" >> rss.xml


(2-2/6)