#!/bin/bash
# Genera una estructura html a partir de ficheros md (markdown)
# 1. Genera la estructura de directorios
# 2. Construye los html
# 3. Genera un fichero índice con un enlace a todos los documentos
OUTPUT=HTML
if [ ! -d $OUTPUT ];
then
mkdir $OUTPUT
fi
files=($(find ./ -type f -name '*.md'))
for i in ${files[*]}
do
printf " Procesando %s..." "${i}"
if [ ! -d "$OUTPUT/$(dirname ${i})" ];
then
mkdir "$OUTPUT/$(dirname ${i})"
printf ".."
fi
pandoc -s -S -t html "${i}" -o "${OUTPUT}/$(dirname ${i})/$(basename ${i%.md}.html)"
printf "... ok\n"
done
#!/bin/bash while [ true ] ; # se estará ejecutando indefinidamente do mem=`free -m |awk ‘NR==2 {print $4}’` # free -> da la memoria libre del sistema # -m : en megas # awk -> extrae texto # NR==2 : la 2ª línea # {print $4}: la 4ª columna if [ $mem -lt 10 ];…
find -type f -exec grep -l "texto_busqueda" {} + y si queremos que la búsqueda sea exacta (por palabras) find -type f -exec grep -lw "texto_busqueda" {} +