formatting, quoting, & typo
This commit is contained in:
parent
6ea0433619
commit
aba50c2843
@ -1,9 +1,9 @@
|
|||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
|
|
||||||
# defin the target dir
|
# define the target dir
|
||||||
parent=$(dirname "${BASH_SOURCE[0]}")
|
parent="$(dirname "${BASH_SOURCE[0]}")"
|
||||||
cd $parent; cd ../../../
|
cd "$parent"; cd ../../../
|
||||||
directory=$(pwd -P)
|
directory="$(pwd -P)"
|
||||||
|
|
||||||
today="$(date "+%Y-%m-%d")"
|
today="$(date "+%Y-%m-%d")"
|
||||||
|
|
||||||
@ -11,24 +11,29 @@ printf "Date: %s\n" "$today"
|
|||||||
|
|
||||||
for dirs in "$directory"/*; do
|
for dirs in "$directory"/*; do
|
||||||
string="$(printf "---\n")"
|
string="$(printf "---\n")"
|
||||||
area=$(basename "${dirs}")
|
area="$(basename "${dirs}")"
|
||||||
if [ "$area" != "System Volume Information" ]; then
|
if [ "$area" != "System Volume Information" ]; then
|
||||||
|
|
||||||
string="$(printf "%stitle: %s\n" "$string" "$area")"
|
string="$(printf "%stitle: %s\n" "$string" "$area")"
|
||||||
string="$(printf "%sdate: %s\n" "$string" "$today")"
|
string="$(printf "%sdate: %s\n" "$string" "$today")"
|
||||||
string="$(printf "%s---\n\n" "$string")"
|
string="$(printf "%s---\n\n" "$string")"
|
||||||
|
|
||||||
for cats in "$dirs"/*; do
|
for cats in "$dirs"/*; do
|
||||||
category=$(basename "${cats}")
|
category="$(basename "$cats")"
|
||||||
string="$(printf "%s# %s\n\n" "$string" "$category")"
|
string="$(printf "%s# %s\n\n" "$string" "$category")"
|
||||||
|
|
||||||
for ids in "$cats"/*; do
|
for ids in "$cats"/*; do
|
||||||
ident=$(basename "${ids}")
|
ident="$(basename "$ids")"
|
||||||
string="$(printf "%s* %s\n" "$string" "$ident")"
|
string="$(printf "%s* %s\n" "$string" "$ident")"
|
||||||
done
|
done
|
||||||
|
|
||||||
string="$(printf "%s\n" "$string")"
|
string="$(printf "%s\n" "$string")"
|
||||||
done
|
done
|
||||||
|
|
||||||
savedir="$directory/00-09 Index/00 Index/00.01 Index/"
|
savedir="$directory/00-09 Index/00 Index/00.01 Index/"
|
||||||
fname="${area:0:5}.md"
|
fname="${area:0:5}.md"
|
||||||
fullpath="$savedir$fname"
|
fullpath="$savedir$fname"
|
||||||
|
|
||||||
printf '%s\n' "$fullpath"
|
printf '%s\n' "$fullpath"
|
||||||
printf '%s' "$string" > "$fullpath"
|
printf '%s' "$string" > "$fullpath"
|
||||||
fi
|
fi
|
||||||
|
Loading…
Reference in New Issue
Block a user