« Auto-éditer un wikilivre/Auto-référencer/ajouter sclic.sh » : différence entre les versions

Contenu supprimé Contenu ajouté
m WL:RD : * diverses retouches
WL:RD : * diverses retouches, ! mise en page
Ligne 1 :
<syntaxhighlight lang="bash">
#! /bin/bash
VERSION=200623
#P Nom du fichier de commandes : ajouter_sclic
#P Syntaxe : "ajouter_sclic <nom du livre>"
Ligne 65 ⟶ 66 :
 
#O## ajouter_scli_classique ###########
if [ $0=ajouter_sclic ]; then echo "ajouter_sclic : Version "$VERSION; fi
 
#0 initialisation de la variables $PageScliC, avec le premier paramètre de la
#O ligne de commande "ajouter_sclic <livre>" où "livre" = variable $1
Ligne 119 ⟶ 122 :
# #T cat $Projet/$1/$1.files | awk -F"=" '{for (i=1;i<=NF;i++) print $i "\n"}' |grep -A 2 https|cut -d '"' -f2
# #T |grep -B 2 image|tr '\n' !|cut -d ! -f1-3
#cat $Projet/$1/$1.files | awk -F "=" '{for (i=1;i<=NF;i++) print $i "\n"}' | grep https | sed "s/\"/!/g" | cut -d '!' -f3f2-3 | grep https | tr '>' ! | sed "s/<\/a//g" |sed "s/!//g" > $Projet/$1/$1.links
cat $Projet/$1/$1.files | awk -F "=" '{for (i=1;i<=NF;i++) print $i "\n"}' | grep https | sed "s/\"/!/g" | cut -d '!' -f2-3 | grep https | tr '>' ! | sed "s/<\/a//g" |sed "s/!/\n/g" | grep https |grep -v 'upload' > $Projet/$1/$1.links
 
exit 0
#O télécharger les fichiers d'images depuis le serveur wikimedia.
# #T wget -P $Projet/$1 -i $Projet/$1/$1.links
Ligne 214 ⟶ 218 :
 
exit 0
# Fin de ajouter_sclic .sh
</syntaxhighlight>
# {{AutoCat}}