Skip to main content
Added " to handle space in filename
Source Link
hschou
  • 3k
  • 14
  • 16
  1. Search for '*.adoc' files

  2. Test if filename.adoc is newer than filename.html

  3. if so, run asciidoctor on it

    find . -name '*.adoc' | while read FILE; do [ $"${FILE}" -nt $"${FILE%adoc}htmlhtml" ] && asciidoctor -q $"${FILE}" ; done 

or put in a script:

#! /bin/bash find . -name '*.adoc' | while read FILE; do if [ $"${FILE}" -nt $"${FILE%adoc}htmlhtml" ]; then asciidoctor -q $"${FILE}" fi done 

The one-line or the script can be run from crontab each minut:

crontab -e 

add a line

* * * * * /home/joe/update_adoc.bash 
  1. Search for '*.adoc' files

  2. Test if filename.adoc is newer than filename.html

  3. if so, run asciidoctor on it

    find . -name '*.adoc' | while read FILE; do [ ${FILE} -nt ${FILE%adoc}html ] && asciidoctor -q ${FILE} ; done 

or put in a script:

#! /bin/bash find . -name '*.adoc' | while read FILE; do if [ ${FILE} -nt ${FILE%adoc}html ]; then asciidoctor -q ${FILE} fi done 

The one-line or the script can be run from crontab each minut:

crontab -e 

add a line

* * * * * /home/joe/update_adoc.bash 
  1. Search for '*.adoc' files

  2. Test if filename.adoc is newer than filename.html

  3. if so, run asciidoctor on it

    find . -name '*.adoc' | while read FILE; do [ "${FILE}" -nt "${FILE%adoc}html" ] && asciidoctor -q "${FILE}" ; done 

or put in a script:

#! /bin/bash find . -name '*.adoc' | while read FILE; do if [ "${FILE}" -nt "${FILE%adoc}html" ]; then asciidoctor -q "${FILE}" fi done 

The one-line or the script can be run from crontab each minut:

crontab -e 

add a line

* * * * * /home/joe/update_adoc.bash 
- echo
Source Link
hschou
  • 3k
  • 14
  • 16
  1. Search for '*.adoc' files

  2. Test if filename.adoc is newer than filename.html

  3. if so, run asciidoctor on it

    find . -name '*.adoc' | while read FILE; do [ ${FILE} -nt ${FILE%adoc}html ] && asciidoctor -q ${FILE} ; done 

or put in a script:

#! /bin/bash find . -name '*.adoc' | while read FILE; do if [ ${FILE} -nt ${FILE%adoc}html ]; then echo asciidoctor -q ${FILE} fi done 

The one-line or the script can be run from crontab each minut:

crontab -e 

add a line

* * * * * /home/joe/update_adoc.bash 
  1. Search for '*.adoc' files

  2. Test if filename.adoc is newer than filename.html

  3. if so, run asciidoctor on it

    find . -name '*.adoc' | while read FILE; do [ ${FILE} -nt ${FILE%adoc}html ] && asciidoctor -q ${FILE} ; done 

or put in a script:

#! /bin/bash find . -name '*.adoc' | while read FILE; do if [ ${FILE} -nt ${FILE%adoc}html ]; then echo asciidoctor -q ${FILE} fi done 

The one-line or the script can be run from crontab each minut:

crontab -e 

add a line

* * * * * /home/joe/update_adoc.bash 
  1. Search for '*.adoc' files

  2. Test if filename.adoc is newer than filename.html

  3. if so, run asciidoctor on it

    find . -name '*.adoc' | while read FILE; do [ ${FILE} -nt ${FILE%adoc}html ] && asciidoctor -q ${FILE} ; done 

or put in a script:

#! /bin/bash find . -name '*.adoc' | while read FILE; do if [ ${FILE} -nt ${FILE%adoc}html ]; then asciidoctor -q ${FILE} fi done 

The one-line or the script can be run from crontab each minut:

crontab -e 

add a line

* * * * * /home/joe/update_adoc.bash 
Source Link
hschou
  • 3k
  • 14
  • 16

  1. Search for '*.adoc' files

  2. Test if filename.adoc is newer than filename.html

  3. if so, run asciidoctor on it

    find . -name '*.adoc' | while read FILE; do [ ${FILE} -nt ${FILE%adoc}html ] && asciidoctor -q ${FILE} ; done 

or put in a script:

#! /bin/bash find . -name '*.adoc' | while read FILE; do if [ ${FILE} -nt ${FILE%adoc}html ]; then echo asciidoctor -q ${FILE} fi done 

The one-line or the script can be run from crontab each minut:

crontab -e 

add a line

* * * * * /home/joe/update_adoc.bash