Simplification de la commande find pour la sortie HTML
This commit is contained in:
@@ -17,5 +17,19 @@ fi
|
||||
|
||||
# afficher les dernières lignes des fichiers log pour voir les les exports se sont bien déroulés
|
||||
echo "<h3>Vérification des dernières lignes dans les logs :</h3>"
|
||||
find "${EXPDP_DIR}" -iname "export_*.log" \
|
||||
-exec bash -c 'echo "<b>--- {} ---</b><pre>"; head -10 "{}"; echo "</pre><pre>"; tail -10 "{}"; echo "</pre>"' \;
|
||||
# find "${EXPDP_DIR}" -iname "export_*.log" -exec bash -c 'echo "<b>--- {} ---</b><pre>"; head -10 "{}"; echo "</pre><pre>"; tail -10 "{}"; echo "</pre>"' \;
|
||||
# autre façon d'écrire la commande find : définition de la fonction d'affichage plus lisible
|
||||
show_log_excerpt() {
|
||||
local file="$1"
|
||||
echo "<b>--- ${file} ---</b>"
|
||||
echo "<pre>"
|
||||
head -10 "$file"
|
||||
echo "</pre><pre>"
|
||||
tail -10 "$file"
|
||||
echo "</pre>"
|
||||
}
|
||||
# export pour rendre la fonction accessible à bash -c
|
||||
export -f show_log_excerpt
|
||||
|
||||
# find appelle la fonction en lui passant $0 comme paramètre
|
||||
find "${EXPDP_DIR}" -iname "export_*.log" -exec bash -c 'show_log_excerpt "$0"' {} \;
|
||||
Reference in New Issue
Block a user