How to Recursively Bash convert all your HTML to Markdown files with Pandoc

You can recursively convert all your HTML files to Mardown format in Bash, by using Pandoc. find . \-name "*.ht*" | while read i; do pandoc -f html -t markdown "$i" -o "${i%.*}.md"; done

March 29, 2023 · 1 min · 34 words · Andrew

How to Check if a Volume is Mounted in Bash

If you need to check if a volume is mounted in a Bash script, then you can do the following. How to Check Mounted Volumes First we need to determine the command that will be able to check. This can be done with the /proc/mounts path. How to Check if a Volume is Mounted in Bash if grep -qs '/mnt/foo ' /proc/mounts; then echo "It's mounted." else echo "It's not mounted....

August 12, 2022 · 1 min · 136 words · Andrew

How to Determine if a Bash Variable is Empty

If you need to check if a bash variable is empty, or unset, then you can use the following code: if [ -z "${VAR}" ]; The above code will check if a variable called VAR is set, or empty. What does this mean? Unset means that the variable has not been set. Empty means that the variable is set with an empty value of "". What is the inverse of -z?...

August 11, 2022 · 2 min · 287 words · Andrew