Skip to content

Instantly share code, notes, and snippets.

@paikwiki
Created March 20, 2018 05:17
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save paikwiki/2a09dfbbfe10ce5d6a16317ca5b16e7f to your computer and use it in GitHub Desktop.
Save paikwiki/2a09dfbbfe10ce5d6a16317ca5b16e7f to your computer and use it in GitHub Desktop.
Make markdown files for gitbook
#!/bin/bash
# names : names of files
# dirName : target directory
names=("section01.md"
"section02.md"
"section03.md"
"section04.md"
"section05.md"
"section06.md")
dirName="docs/ch01/"
# If target directory doesn't exist, make it
if [ ! -d $dirName ]
then
mkdir -p $dirName
fi
# Create empty files from names
for name in "${names[@]}"; do
touch ${dirName}$name
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment